graphic radio buttons

Mark Mitchell mark_mitchell at kmug.org
Mon Feb 11 01:49:00 EST 2002


>>Ken writes:
>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:
>
>on mouseUp
>  RBbehavior
>end mouseUp
>
>on RBbehavior
>  if i is not empty then
>    set the selected of graphic ID i to false
    resetStuff -- maybe to graphic ID i?
  end if
  put the ID of the target into i
  set the selected of the target to true
  doStuff -- maybe to the target?
end RBbehavior

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?

mark m




More information about the use-livecode mailing list