Dynamic menubar menus in OSX

Sarah Reichelt sarahr at genesearch.com.au
Mon Jul 5 19:34:21 EDT 2004


Hi Howard,
When using Mac menus, any mouseDown handlers for setting the menus need 
to be in the menu bar script, rather than in the menu buttons 
themselves. Also, "the target" is never set to a specific button, so 
you need to do all the setup whenever the menu bar gets a mouseDown, 
rather than testing for a certain menu.

Cheers,
Sarah

On 6 Jul 2004, at 7:54 am, Howard Bornstein wrote:

> Hmm. This must be something so obvious I'm completely missing it. I'm 
> trying to create a dynamic menu in the menubar. Something that gets 
> set when the user clicks the menu. So for a test, I create a stack and 
> use the Menu Builder to build a standard menu. I add a new menu item 
> called Ticks. In the script of the button Ticks, I put:
>
> On mousedown
>   put the ticks into me
> end Mousedown
>
> If the editmenus property of the stack is true, the menus show up on 
> the stack under OSX. If I click the Ticks menu, it puts a new ticks 
> value as the menu item each time I click it (as expected). However, 
> when I set the editmenus property to false, so that it shows up in the 
> regular Mac menubar, the Ticks menu only shows the last value placed 
> there (when editmenus was true). IOW, once the menu appears in the 
> regular Mac menubar, it no longer seems to respond to the mousedown 
> handler. A MenuPick handler in the button works fine, but not a 
> mousedown or mouseup handler.  Why?



More information about the use-livecode mailing list