Mathematica Technical FAQs Services & Resources / Mathematica / Notebook Interface
-----
 /
Buttons & Hyperlinks
*Mathematica
*Network Mathematica
*webMathematica
*gridMathematica
*Personal Grid Edition
*Wolfram Workbench
*Wolfram Education Group
*Application Packages
*Mathematica for Students
*Mathematica CalcCenter
*Publicon
*A New Kind of Science Explorer
*Mathematical Explorer
*Mathematica Teacher's Edition
*Calculus WIZ
*Mathematica Player
*Ask about this page
*Print this page
*Email this page
*Give us feedback
*
Sign up for our newsletter:

How do arguments get passed to ButtonFunction?

The ButtonFunction determines the action of the button when pressed. The ButtonFunction can take zero to two arguments. What is taken as arguments can be controlled with ButtonData and ButtonSource.

No arguments. For example,

In[1]:=
 

 
 

This button produces the following output.

test

 

ButtonData and ButtonSource have no effect on the button.

One argument. The default is to use the ButtonContents.

In[2]:=
 

 
 

This button produces the following output.

mytest

 

You can replace ButtonContents by specifying ButtonData and using the default value of ButtonSource.

In[3]:=
 

 
 

This button produces the following output.

test

 

This allows the button to show one thing but to act on something else. If you set ButtonSource then this specified source is used.

In[4]:=
 

 
 

This button produces the following output.

 

 

Two arguments. In the two argument form, the first argument is determined exactly as it is in the one argument form. The second argument is always the ButtonData. If ButtonData is not explicitly given, then its default value, Automatic is used.

In[5]:=
 

 
 

This button produces the following output.

mytest

Automatic

Download this FAQ as a Mathematica 5.2 Notebook






 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy | [ja]