"Arming" a pulldown menu button -- a hack

Sarah Reichelt sarah.reichelt at gmail.com
Wed Mar 22 20:34:52 EST 2006

On 3/23/06, Sivakatirswami <katir at hindu.org> wrote:
> As we know, at least on Mac OSX, for a pulldown menu button, setting
> the autoArm, autohilite and Armed to true and applying a different
> icon to those states does not take effect. Nothing happens.. Worse:
> In fact one of those properties, if set to true, interferes with the
> proper action (menu does not open) So, we see now why those
> properties are not offered in the inspector for such menu buttons.
> So, I tried this work around... and it seems to work just  fine...
> on mousewithin
>    set the icon of me to 1115
> end mousewithin
> on mouseleave
>     set the icon of me to 1114
> end mouseleave
> on menuPick pItemChosen
> switch pItemChosen
> ## do stuff here
> end switch
> end menupick
> Does anyone know if there are any caveats to this? the two mouse
> activity handlers to not see to interfere at all with functionality.

You may want to add a mouseRelease handler as well. This allows for
the user mousing down on the control, moving off it and mousing up.
I'm not sure that mouseLeave would get sent in those circumstances.


More information about the Use-livecode mailing list