MathGroup Archive 2008

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

Search the Archive

RadioButton Question


Hi, Can anyone suggest how I can get some radio buttons to run
functions, rather than just set a variable?

This is a statement to create two buttons that set a value:-

RadioButtonBar[Dynamic[state], {"Existing", "New"}]


The following code runs functions, but also shows the buttons in a
list, along with some output.  Any suggestions how I can achieve
this functionality but with only the buttons and labels showing, as
above?


dofunction1[] := x = 1;

dofunction2[] := x = 2;

Module[{state = "Existing"},
 {RadioButtonBar[Dynamic[state], {"Existing", "New"}],
  Dynamic[If[state == "Existing", dofunction1[], dofunction2[]]]}]



  • Prev by Date: Call for papers in K-16 Math Education
  • Next by Date: Re: Package conversion to V6
  • Previous by thread: Call for papers in K-16 Math Education
  • Next by thread: Re: RadioButton Question