Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Radio buttons panel

  • To: mathgroup at smc.vnet.net
  • Subject: [mg102361] Radio buttons panel
  • From: "King, Peter R" <peter.king at imperial.ac.uk>
  • Date: Fri, 7 Aug 2009 05:27:42 -0400 (EDT)
  • References: <h4m4ca$ecg$1@smc.vnet.net> <h4p3g1$itm$1@smc.vnet.net>

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.


  • Prev by Date: Re: Linear Interpolation problems
  • Next by Date: Re: Linear Interpolation problems
  • Previous by thread: Re: Re: Making your own Definitions using Operators without
  • Next by thread: Re: Radio buttons panel