I would like to create a button which has the action of storing a numerical input. Is this possible?
For example, a button which I click, then enter "5", produces the result the the number 5 gets stored somewhere based on which button I clicked.
I would like to create a button which has the action of storing a numerical input. Is this possible?
For example, a button which I click, then enter "5", produces the result the the number 5 gets stored somewhere based on which button I clicked.
Try this for a simple approach:
{SetterBar[Dynamic[x], Range[10]], Dynamic[x]}
or if you want to compute a simple function of your number:
{SetterBar[Dynamic[x], Range[10]], Dynamic[x], Dynamic[N[Cos[x]]]}
If you want it to look nice:
Column[{SetterBar[Dynamic[x], Range[10]],
Dynamic[x],
Dynamic[N[Cos[x]]]}, Center]