Preference for Keeping Saved Empty Button Scripts Empty
Sannyasin Brahmanathaswami
brahma at hindu.org
Mon Jun 19 11:19:06 EDT 2017
I wrote support "complaining" that after I clear the
on mouseup
end mouseUp
that is inserted in button scripts by default, apply, close, save. Then later if one inadvertently opens the script of that button, the script is reinserted. Panos replied this is the default behavior….gave me a hack to
" edit the script of stack "revSEUtilities" at 1097"
and remove the l nes that inserted that automatically. For this to persist you have to get hands dirty changing permission in the bundle, save the stack etc…then of course on upgrade.. that's gone… Quite a hack
Now that I'm slowly mastering the separation of code from GUI, I find myself more and more leaving buttons empty and then using, farther up the hierarchy (in a behavior, or back script)
-------------
on mouseup
put the short name of the target into tMouseEvent
switch tMouseEvent
case "whatever
break
end switch
end mouseup
-----------------
of course if your button ends up with
on mouseup
end mouseup
and you don't pass… your script appears "dead" as it never gets the target msg.
This same thing is also happening to widget that I remove the scripts from completely. which is even more irritating, since in someone's infinite wisdom they assumed we always want to toggle the hilite of the widget. This is so persistent that I have come not to a) set the color of the widget b) set the hilite color the same so that if that Toggle command gets back in there.. nothing happens, visually, because if you save the stack after the highlight is toggle it is "stuck" with the hilite color. (a gotcha for newbies too)
so, does it make sense to request a feature enhancement to add a preference to *not* insert any handler in buttons/widgets, whose scripts are empty if inadvertently opened? there would need to be a way to differentiate between one newly created vs one that was previously instantiated, whose script had been emptied and saved
BR
More information about the use-livecode
mailing list