Determining which menu button was clicked on Mac
Brian Yennie
briany at qldlearning.com
Thu Jan 8 02:34:52 EST 2004
Perhaps, but I think Trevor's question was how to avoid checking
whether anything is playing regardless of which menu was clicked.
I believe the answer is that you can't.
At least on MacOS, IIRC, the underlying routines can tell you when the
menubar is clicked, but there is no such thing as a menu clicked event
for a single menu. Thus you need to adjust your menus either a) before
the user clicks on the menubar or b) adjust ALL of your menus every
time the user clicks on the menubar.
If you want individual events for clicking on a single menu, I think
you'll have to roll your own menu objects in-window, which means they
won't work as real system menus...
HTH
Brian
> Hmmm. I think a more "standard" way of dealing with this is to have
> both "Play" and "Pause" menuItems, one of which is grayed out at any
> given time. This works for me in a menuPick handler - initially
> "Pause" is disabled, then when the user selects "Play" the enabled and
> disabled options are switched. I also think it gives the user more of
> a sense of continuity than menu items that appear and disappear.
More information about the use-livecode
mailing list