Determining which menu button was clicked on Mac

Thomas J McGrath III 3mcgrath at adelphia.net
Thu Jan 8 11:39:42 EST 2004


I use this script in a "GoTo" menu to check if the sound is done 
playing on one particular card with a lot of animations (that caused 
errors if the card was left prematurly) I exit the menuPick so the user 
has to wait till sound is done.
Don't know what behavior you want but "if the sound is not done" works 
for me.

on menuPick pWhich
   put the short name of this card into gna
   if gna is "Main 2" then
     if the sound is not done then
       exit menuPick
     end if
   end if
   go to card pWhich of stack "UnityCD"
end menuPick

Tom

On Jan 8, 2004, at 7:42 AM, Trevor DeVore wrote:

> 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
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>

Macintosh PowerBook G-4 OSX 10.3.1, OS 9.2.2, 1.25 GHz, 512MB RAM, Rev 
2.1.2


Advanced Media Group
Thomas J McGrath III	• 2003 •	3mcgrath at adelphia.net
220 Drake Road, Bethel Park, PA 15102





More information about the use-livecode mailing list