Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9046 > unrolled thread

Re: Button Behavior OnClick

Started byBob Hanlon <hanlonr357@gmail.com>
First post2012-03-15 05:30 +0000
Last post2012-03-15 05:30 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Button Behavior OnClick Bob Hanlon <hanlonr357@gmail.com> - 2012-03-15 05:30 +0000

#9046 — Re: Button Behavior OnClick

FromBob Hanlon <hanlonr357@gmail.com>
Date2012-03-15 05:30 +0000
SubjectRe: Button Behavior OnClick
Message-ID<jjrup7$98p$1@smc.vnet.net>
Use RadioButtonBar or SetterBar

RadioButtonBar[Dynamic[x],
 {10! -> "Option A",
  5! -> "Option B",
  5 -> "Option C"}]

Dynamic[x]

SetterBar[Dynamic[y],
 {10! -> "Option A",
  5! -> "Option B",
  5 -> "Option C"}]

Dynamic[y]


Bob Hanlon


On Wed, Mar 14, 2012 at 1:35 AM, Scott Colwell <scolwell@uoguelph.ca> 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"]]
>  }]
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web