2
$\begingroup$

How to make a drop-down selector UI component? Something that looks like this

$\endgroup$

1 Answer 1

5
$\begingroup$

You want to use PopupMenu:

PopupMenu[a, {a, b, c, d}]

Mathematica graphics

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:

Mathematica graphics

$\endgroup$
2
  • $\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$
    – user13253
    Commented Sep 10, 2012 at 18:29
  • $\begingroup$ @MaThEmAtika See my last update. $\endgroup$
    – Eli Lansey
    Commented Sep 10, 2012 at 18:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.