Search All of the Math Forum:

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

 Messages: [ Previous | Next ]
 King, Peter R Posts: 32 Registered: 11/15/05
Posted: Aug 7, 2009 5:27 AM

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

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.

Date Subject Author
7/28/09 Bill Rowe
7/29/09 AES
7/30/09 David Bailey
7/31/09 David Park
7/31/09 Murray Eisenberg
8/7/09 King, Peter R
8/8/09 John Fultz
8/9/09 Bob Hanlon
8/8/09 lshifr@gmail.com
7/29/09 Daniel Warren
7/29/09 Noqsi
7/30/09 Andrzej Kozlowski
7/30/09 DrMajorBob