Determining which menu button was clicked on Mac

Trevor DeVore lists at mangomultimedia.com
Thu Jan 8 07:42:04 EST 2004


On Jan 8, 2004, at 1:09 AM, Mark Wieder wrote:

> I think you're right about menuEvents per se, but in this particular
> case all you have to do is set an isPlaying variable to false, then
> toggle it when the user plays something you *know* whether something's
> playing.

Setting a state variable would work in many cases.  However, with a 
player object you don't receive any messages when the user clicks on 
play/pause (in a quick test I did you don't even get a mouseUp event) 
so the variable would become out of sync with the actual player state 
unless you did a check every x seconds or created custom controls 
rather than using the default QT controls.  In this particular case I 
prefer to do the check in the menubar mouseUp script.

> Maybe I've lost sight of the original question by now, but I believe
> it was the desire to have a "Play" menu option if nothing was playing,
> and a "Pause" option is something was.

That is correct.  It already works, I just wanted to know if there was 
a way to detect which button was clicked in a menubar group so I could 
execute the code *only* when the 'Audio' menu was selected.


-- 
Trevor DeVore
Blue Mango Multimedia
trevor at mangomultimedia.com



More information about the use-livecode mailing list