Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Re: The audience for Mathematica (Was: Show doesn't work inside Do loop ?)
Replies: 20   Last Post: Aug 9, 2009 6:04 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
King, Peter R

Posts: 32
Registered: 11/15/05
Radio buttons panel
Posted: Aug 7, 2009 5:27 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I want to create an input panel using radio buttons. I can easily do this with

Panel[Grid[{{RadioButtonBar[
Dynamic[x], {"X", "34", "36", "56"}]}, {RadioButtonBar[
Dynamic[y], {"X", "34", "36", "56"}]}, {RadioButtonBar[
Dynamic[z], {"X", "34", "36", "56"}]}}]]

Except I want the different variables x, y, z etc to be members of an arrayx[[i]]

x = Table["X", {4}];Panel[Grid[
Table[{RadioButtonBar[Dynamic[x], {"X", "34", "36", "56"}]}, {i, 1,
4}]]]

Doesn't work as it treats x as a scalar not a list.

Panel[Grid[
Table[{RadioButtonBar[Dynamic[x[[i]]], {"X", "34", "36", "56"}]}, {i, 1,
4}]]]

Gives nonsense.

Is there a neat way to do this? (I could easily use the top version then set x[[1]] to x, x[[2]] to y etc (actually I can't use x in two different ways but I'm sure you know what I mean).

Furthermore I want the choice selection in one row to influence what options are available in the next row. Think of the rows as time going downwards. I have free choice of which option I can use in row 1. In the next row then not all options are available. The easiest is that I cannot repeat a selection. So I cannot have X in row 1 followed by X in row 2, so I would like that button blanked out (or greyed in or some such). Perhaps what I want this to look like is initially the panel has all the buttons greyed and unusable except for the first row. Having chosen say 34 from the first row, the second row buttos are "ungreyed" except for 34 (there are some other rules such as 34 cannot be followed by 36 or 56 followed by 36 but I can probably sort that out later).

Finally I want the length of the list (set as 4 above) to be dependent on the result of a drop down menu at the top of the panel - not shown.

I know this is 3 questions not 1 but they are linked.

Thanks in advance.




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.