Menu Bar in MacOS

David Burgun dburgun at dsl.pipex.com
Mon Apr 19 12:15:30 EDT 2004


>  >>  >Hi,
>>>>
>>>>I am trying to figure out the best way of handling the Menu Bar in MacOS.
>>>>
>>>
>>>>Basically what I am asking is how do I share the menu bar with all
>>>>the other stacks (windows) in the App like a regular MacOS
>>>>application?
>>>>
>>>>Thanks in Advance for any Advice
>>>>Cheers
>>>>Dave
>>>
>>>Hello Dave,
>>>
>>>Have a look at the defaultmenubar property in the docs.
>>>
>>>I think that should do what you want
>>>
>>
>>I just tried doing that, I put the following line in the preOpenStack
>>handler of the (dummy) main stack script:
>>
>>set the defaultMenubar to "MainMenuBar"
>>
>>which caused ALL kinds of problems in the IDE while trying to debug,
>>ended up having to edit the Script via the message box, force quit RR
>>and then restart machine!
>>
>>Is this supposed to happen? I am using RunRev 2.2 on MacOS X and Classic.
>>
>
>the defaultmenubar is a global property, clearly it affects revolution too
>when it's running.
>
>I think I would put the "set the defaultmenubar" script in the "on startup"
>handler of the main stack so that it only runs after the stack has been
>built into a standalone and opens.
>
>While developing you could arrange for your mainstack to be visible in the
>IDE perhaps, and just bring it to the front with a click when you want to
>test it. I guess you must be doing something like this already.
>
>>More Info:
>>
>>I used to have a Menu Bar that was located in a Sub-Stack. I deleted
>>the Group from that stack and added a new one to the (dummy) main
>>stack. However when I look via the message box, the menubar property
>>is still set to the old Menubar Group, and as far as I can tell, the
>>old script is still there and being used! However, I cannot see the
>>object in the Application Browser! How can I:
>>
>>1.  Remove it!
>>
>>2.  Stop this from happening again!
>>
>>Thanks a lot
>>Dave
>
>I just tried deleting a menubar, and the menubar property isn't
>automatically cleared when you do that.
>
>So you could just set that property to empty from the message box and see
>if that clears your problems. I'm not saying it necessarily will but you
>could try it.

Yes, I did this and it helped! But I still had problems on the other 
menus. For instance, the old edit menu script was still there and was 
still being run. I found this because that script called a common 
function and so I put a breakpoint in this function and then traced 
to see where it went back to. Bang into weird looking group called 
somethng like "bgnd group id nnnn" something or other! Since I was 
then in the script, I just deleted it and it all started to work 
better.

I just couldn't make the defaultMenubar thing work for me, so decided 
to set the menuBar property of each stack (see seperate post). This 
means that I can hide the mainStack and also have the ability to 
clone from the old MenuBar if I need a custom menu for a specific 
substack.

Thanks for helping
Dave


More information about the use-livecode mailing list