Simulate a popup menu button

Lars Brehmer larsbrehmer at mac.com
Tue Jul 17 15:59:30 EDT 2012


Thanks Craig!

But I still haven't got it figured out.

This ia a popUp button with several cascading items. What I am trying to do is in a tutorial animation. 

1. move the cursor onto the button and then have the meunu appear (click at the buttonLoc). 

2.  move the cursor to the menu choice and have it hilited and show it's cascaded choices (the problem is that it's not really the cursor, just a button whose icon looks just like a cursor)

3. move the cursor (= button) to the cascaded (final) choice and hilite it.

4 execute the choice (send "menuPick" && "theChoice" to btn "theButton"

So 1 and 4 are easy and I can't do 2 and 2. 

My workaround until now has been to have images of the menu appear with the desired hilted choices. But if the menu choices are just images, they can't extend to outside the edge of the stack like a real menu choices can.

Any ideas?

Cheers,

Lars


> Hi.
> 
> 
> Are you using an actual pop-up style button, like a PullDown or cascade?
> 
> 
> Or are you rolling your own, as it seems, when you said 'simulate'?
> 
> 
> If you are making your own, what is the reason to do that?
> 
> 
> If you are using one of the standard button styles, the usual method is something like:
> 
> 
> 
> on menuPick pItemName
>   switch pItemName
>      case "choice 1"
>         answer the menuHistory of me
>   break
> case "choice 2"
>  beep 3
>  break
>   end switch
> end menuPick
> 
> 
> Anyway, read the dictionary about the "menuHistory". It is likely what you are missing.
> 
> 
> Craig Newman
>> 
>> 
>> I am trying to simulate the action of using a popup menubutton, but I can't 
>> figure out how to do the middle step (if that is even possible)
>> 
>>     click at the buttonLoc 
>> 
>> reveals the menu choices and
>> 
>>     send "menuPick" && "the menu choice" 
>> 
>> executes the menuPick. 
>> 
>> But I can't figure out to hilite the menu choice line while the menu is visible. 
>> 
>> 
>>     select menuItem 2 
>> 
>> doesn't actually hilite the menu line. What am I missing here?
>> 
>> Cheers,
>> 
>> Lars




More information about the use-livecode mailing list