This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Setter

Setter
represents a setter button whose setting x is set to val when the button is clicked. The button is labeled with val, and appears pressed if the value of x is val, and unpressed otherwise.
Setter[Dynamic[x], val]
takes the setting to be the dynamically updated current value of x, with the value of x being reset if the button is clicked.
Setter
labels the setter button with label.
Setter
represents a setter button that sets x to if multi-clicked n times.
  • Setter takes x still to be val even if it is clicked more than once.
  • Setter takes x still to be if it is multi-clicked more than n times.
  • The following options can be given:
AppearanceAutomaticthe overall appearance of the setter
AutoActionFalsewhether to change the setter automatically when the mouse is over it
BaselinePositionAutomaticalignment relative to surrounding text
BaseStyle{}base style specifications for the setter
EnabledAutomaticwhether the setter is enabled, or grayed out
ImageMargins0margins around the image of the displayed setter
ImageSizeAllthe overall image size of the displayed setter
  • Typical possible settings for the Appearance option include and . In some cases, , , etc. are also supported.
  • With Appearance->None, label is displayed literally, without being placed in a button.
  • The settings for BaseStyle are appended to the default style typically given by the style in the current stylesheet.
A setter with the setting different from its value, showing as unpressed:
A setter with the setting equal to its value, showing as pressed:
A setter with the label , showing unpressed and pressed states:
Dynamically set the value to 1 or 2 by clicking the respective button:
A setter with the setting different from its value, showing as unpressed:
In[1]:=
Click for copyable input
Out[1]=
A setter with the setting equal to its value, showing as pressed:
In[2]:=
Click for copyable input
Out[2]=
A setter with the label , showing unpressed and pressed states:
In[3]:=
Click for copyable input
Out[3]=
Dynamically set the value to 1 or 2 by clicking the respective button:
In[4]:=
Click for copyable input
Out[4]=
In this case, single-clicking will return and double-clicking will return :
By triple-clicking, this setter will return the setting :
Align labels in the setter:
All possible alignment positions:
Change the appearance:
By default, Setter must be clicked to change the setting:
By setting AutoAction->True, moving the mouse over the setter changes the setting:
Change the background color:
Align with surrounding text:
By default, Setter is enabled:
By setting Enabled->False, the setter is disabled but visible in its current state:
Increase the margins from the label to the frame:
Increase the margins outside the frame:
Alter the overall image size:
Set the size of a graphic:
New in 6