Radio buttons as indicator lights

Graham graham.samuel at wanadoo.fr
Thu Sep 4 06:24:00 EDT 2003


Thanks to all who replied on this one - talk about a quick response! Not 
all the solutions offered solved my specific problem, which is to allow the 
radioBehavior of a group of buttons (seen by the user as a row of indicator 
lights) to be used by the scripter (me) but not to be affected by the user. 
In particular Bill's idea of one light with many states wouldn't suit my 
application (this is a simulation of a real-world situation where rows of 
lights are the normal setup).

Initially I thought that Ken's idea of turning off the radioBehavior would 
have made more work for me, since I want to ensure that only one or zero 
lights are on in the row. However, the radio behavior (rather than the 
property of that name) apparently persists even when the property is turned 
off, in the sense that a script

   set the hilitedButtonName of group "indicators" to "My Button"

Still turns off any button in the group that happens to be on, apart from 
"My Button"!

I would never have guessed this, but it is so. Thus I can get the effect I 
want by grouping a series of radio buttons whose keyboard focus and 
autohilite is turned off. I can then use Ken's solution to hilite one 
button at a time, while automatically turning off any previously hilited 
button.

AFAIK Yoy's suggestion to ungroup the buttons would also leave me without 
radio Behavior as described above (because there would be no group to 
contain the property). Greg Lypny's idea to

Layer the radio buttons under a transparent (invisible) graphic.

was fine, but I think Ken's was neater.

thanks again

Graham

---------------------------------------------------
Graham Samuel / The Living Fossil Co. / UK & France  





More information about the use-livecode mailing list