({{, (RefLink[Setter, paclet:ref/Setter])[x,val]
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.}, {, (RefLink[Setter, paclet:ref/Setter])[(RefLink[Dynamic, paclet:ref/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.}, {, (RefLink[Setter, paclet:ref/Setter])[x,val,label]
labels the setter button with label.}, {, (RefLink[Setter, paclet:ref/Setter])[x,{(Subscript[val, 1]),(Subscript[val, 2]),…},label]
represents a setter button that sets x to (Subscript[val, n]) if multiclicked n times. }})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[Setter, paclet:ref/Setter])[x,val] takes x still to be val even if it is clicked more than once.

(RefLink[Setter, paclet:ref/Setter])[x,{(Subscript[val, 1]),…,(Subscript[val, n])},label] takes x still to be (Subscript[val, n]) if it is multiclicked more than n times.

The following options can be given:

Typical possible settings for the (RefLink[Appearance, paclet:ref/Appearance]) option include "Frameless" and "Palette". In some cases, "AbuttingLeftRight", "AbuttingRight", etc. are also supported.

With (RefLink[Appearance, paclet:ref/Appearance])->(RefLink[None, paclet:ref/None]), label is displayed literally, without being placed in a button.

The settings for (RefLink[BaseStyle, paclet:ref/BaseStyle]) are appended to the default style typically given by the "Setter" style in the current stylesheet.

OpenersPrimaryExamplesSection(Spacer1)Examples  (14)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

A setter with the setting different from its value, showing as unpressed:

Setter[0,1]

A setter with the setting equal to its value, showing as pressed:

Setter[1,1]

A setter with the label α, showing unpressed and pressed states:

{Setter[0,1,"α"],Setter[1,1,"α"]}

Dynamically set the value to 1 or 2 by clicking the respective button:

{Setter[Dynamic[x],1],Setter[Dynamic[x],2]}

OpenersExampleSection1(Spacer1)Scope  (2)

In this case, single-clicking will return 1 and double-clicking will return 2:

{Setter[Dynamic[x],{1,2},α],Dynamic[x]}

By triple-clicking, this setter will return the setting 3:

{Setter[Dynamic[x],{1,2,3},α],Dynamic[x]}

OpenersExampleSection2(Spacer1)Options  (9)

OpenersExampleSubsection0(Spacer1)Alignment  (1)

Align labels in the setter:

Table[Setter[1,0,ImageSize->{30,30},Alignment->a],{a,{Left,Right,Center,Bottom,Top}}]

All possible alignment positions:

Table[Setter[1,0,ImageSize->{30,30},Alignment->{j,i}],{i,{Top,Center,Bottom}},{j,{Left,Center,Right}}]//Grid

OpenersExampleSubsection1(Spacer1)Appearance  (1)

Change the appearance:

Table[Setter[0,1,Appearance->a],{a,{"Frameless","Palette"}}]

OpenersExampleSubsection2(Spacer1)AutoAction  (1)

By default, (RefLink[Setter, paclet:ref/Setter]) must be clicked to change the setting:

Setter[0,1]

By setting (RefLink[AutoAction, paclet:ref/AutoAction])->(RefLink[True, paclet:ref/True]), moving the mouse over the setter changes the setting:

Setter[0,1,AutoAction->True]

OpenersExampleSubsection3(Spacer1)Background  (1)

Change the background color:

Table[Setter[1,0,Background->a],{a,{Pink,Gray,Yellow,Purple}}]

OpenersExampleSubsection4(Spacer1)BaselinePosition  (1)

Align with surrounding text:

Row[Table[Setter[0,1,BaselinePosition->p],{p,{Top,Center,Bottom}}],"xxx"]

OpenersExampleSubsection5(Spacer1)Enabled  (1)

By default, (RefLink[Setter, paclet:ref/Setter]) is enabled:

{Setter[Dynamic[x],0],Setter[Dynamic[x],1]}

By setting (RefLink[Enabled, paclet:ref/Enabled])->(RefLink[False, paclet:ref/False]), the setter is disabled, but visible in its current state:

{Setter[Dynamic[y],0,Enabled->False],Setter[Dynamic[y],1,Enabled->False]}

OpenersExampleSubsection6(Spacer1)FrameMargins  (1)

Increase the margins from the label to the frame:

Table[Setter[1,1,FrameMargins->m],{m,{0,10,20}}]

OpenersExampleSubsection7(Spacer1)ImageMargins  (1)

Increase the margins outside the frame:

Table[Style[Setter[1,1,ImageMargins->m],Background->Black],{m,{0,10,20}}]

OpenersExampleSubsection8(Spacer1)ImageSize  (1)

Alter the overall image size:

Grid[Table[Setter[0,1,ImageSize->{w,h}],{h,{20,30,40}},{w,{20,30,40}}]]

OpenersExampleSection3(Spacer1)Applications  (1)

Set the size of a graphic:

DynamicModule[{x},
Column[{Row[{Setter[Dynamic[x],"Small"],Setter[Dynamic[x],"Medium"]}],Plot[Sin[x],{x,0,10},ImageSize->Dynamic[x]]}]]

OpenersExampleSection4(Spacer1)Properties & Relations  (1)

(RefLink[RadioButton, paclet:ref/RadioButton]) is a special case of (RefLink[Setter, paclet:ref/Setter]):

{RadioButton[Dynamic[x],0],RadioButton[Dynamic[x],1]}

{Setter[Dynamic[y],0],Setter[Dynamic[y],1]}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[SetterBar, paclet:ref/SetterBar])  ▪  (RefLink[RadioButton, paclet:ref/RadioButton])  ▪  (RefLink[Checkbox, paclet:ref/Checkbox])  ▪  (RefLink[Toggler, paclet:ref/Toggler])  ▪  (RefLink[Button, paclet:ref/Button])  ▪  (RefLink[PopupMenu, paclet:ref/PopupMenu])  ▪  (RefLink[Panel, paclet:ref/Panel])  ▪  (RefLink[Set, paclet:ref/Set])  ▪  (RefLink[FileNameSetter, paclet:ref/FileNameSetter])  ▪  (RefLink[ColorSetter, paclet:ref/ColorSetter])  ▪  (RefLink[Trigger, paclet:ref/Trigger])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Introduction to Dynamic, paclet:tutorial/IntroductionToDynamic])}, {▪(RefLinkPlain[Introduction to Control Objects, paclet:tutorial/IntroductionToControlObjects])}, {▪(RefLinkPlain[Generalized Input, paclet:tutorial/GeneralizedInput])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Control Objects, paclet:guide/ControlObjects])}})}})