How to make a drop-down selector UI component? Something that looks like this
1 Answer
You want to use PopupMenu
:
PopupMenu[a, {a, b, c, d}]
Note, if you want it to be dynamically linked to a variable, use:
PopupMenu[Dynamic[x], {a, b, c, d}]
Then, x
takes the value given by the drop down menu:
-
$\begingroup$ I don't need to show anything such as a plot that depends on the value selected in the drop-down. Rather, I just need a state-recorder that knowns the user's selection in the menu which can later be read out from the notebook. $\endgroup$– qazwsxSep 10, 2012 at 18:29
-