graphic radio buttons
mark_mitchell at kmug.org
Mon Feb 11 01:49:00 EST 2002
>This works just fine, of course, for selecting the object. That is, until
>you have, what was it?...30,000 of them. Then the loop will have the user
>getting pretty long in the tooth before the clicked object gets selected.
>You can, however, store the ID of the last object clicked, and just deselect
>it when you select the next one. There is no loop involved. You can even use
>one offscreen handler (subroutine) to do it, as well as whatever other
>operations happen, even ones specific to the ID of the object, which is what
>radio buttons are generally used for.
>How about this:
> if i is not empty then
> set the selected of graphic ID i to false
resetStuff -- maybe to graphic ID i?
put the ID of the target into i
set the selected of the target to true
doStuff -- maybe to the target?
Or, as someone else suggested, which might be a little more intuitive than the script above,
simply set a customProperty of your group to the currently selected, then deselect that using
a group script. Frankly, I'm not sure of the advantage of using a customProperty over a simple
global variable (again, consulted in the GROUP script) for something like this.
I suppose a customProp will preserve last selected even
between use sessions whereas a global will not. Is that all?
More information about the Use-livecode