MathGroup Archive 2012

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

Search the Archive

Re: Button Behavior OnClick

Thanks.  Found a better option. Since I need the button to direct a few variables, I just added

Appearance -> If[Dynamic[x] == 1, "Pressed", "DialogBox"]


----- Original Message -----
From: "Bob Hanlon" <hanlonr357 at>
To: "Scott Colwell" <scolwell at>
Cc: mathgroup at
Sent: Wednesday, 14 March, 2012 9:25:40 AM
Subject: [mg125489] Re: Button Behavior OnClick

Use RadioButtonBar or SetterBar

 {10! -> "Option A",
  5! -> "Option B",
  5 -> "Option C"}]


 {10! -> "Option A",
  5! -> "Option B",
  5 -> "Option C"}]


Bob Hanlon

On Wed, Mar 14, 2012 at 1:35 AM, Scott Colwell <scolwell at> wrote:
> This seems like it should be simple enough to do, but I can't figure it out.
> How do you get a button to look like it is pressed only when it has been pressed, and then unpressed when another button is selected.
> Seems to me there should be a simple OnClick command that says If A is pressed, then make A looked pressed but not B. If B is pressed, then make B look pressed but not A. I can sort of get the effect with mouseover but it doesn't stay.  Any ideas?
> Row[{
>  Mouseover[Button["Option A", Print[10!]],
>   Button["Option A", Print[10!], Appearance -> "Pressed"]],
>  Spacer[10],
>  Mouseover[Button["Option B", Print[10!]],
>   Button["Option B", Print[10!], Appearance -> "Pressed"]]
>  }]

Scott R. Colwell, Ph.D.
Associate Professor, Dept. of Mkt/Cons Studies
Adjunct Professor, Dept. of Psychology
MINS Building 201a
University of Guelph
Guelph, Ontario, Canada, N1G 2W1

  • Prev by Date: Re: Message using FindFit with LevenbergMarquardt Method
  • Next by Date: Re: Message using FindFit with LevenbergMarquardt Method
  • Previous by thread: Re: Button Behavior OnClick
  • Next by thread: Re: Button Behavior OnClick