Message Boards Message Boards

0
|
3441 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Check PopupMenu answer

Posted 7 years ago

I use this function to generate a graphic and a PopupMenu:

Labeled[listar1 = {PopupMenu[Dynamic[r1], {"Sen","Cos","Tan"}]};
         Plot[Sin[x],{x, -2 Pi, 2 Pi}, PlotStyle->Red,PlotRange->{-4,4},ImageSize->Large],
         Column[Flatten[{Text["Which function?"],listar1}]],Right];

After a user has answer the question, how can I check the value of the PopupMenu and display a green/red rectangular or a phrase to indicate him that he is right/wrong?

Anonymous User
Anonymous User
Posted 7 years ago

let me suggest two things.

1) your going about it backwards meaning plots with check-boxes are show in Help for Manipulate using PopupMenus, but not for PopupMenus with Dynamic. Using Dynamic will be more difficult unless used as seen in Help. I would guess it's possible but "lower level" usage, and so there will be less help and potentially less support with future versions.

2) see: ref/CurrentValue

3) you might consider using ChoiceDialog or some interface element designed to return a choice.

POSTED BY: Anonymous User
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract