Menu bars on main stack and different menus on substacks

J. Landman Gay jacque at hyperactivesw.com
Mon Dec 8 11:45:06 EST 2008


william humphrey wrote:
> Menubars on main stack and substack
> Hi
> 
> I know what happens with a menu on the mainstack and none on any of the
> substacks but I was wondering how to implement a menu that changes depending
> on what stack is opened. If you put a different menubar in a substack does
> it happen automatically?

On Windows, yes. Menus on that OS are just groups, and they will show up 
automatically in whatever stack you place them.

On Mac OS, the menubar group is moved to the system menu (and the stack 
size is shortened as the menu scrolls out of view off the top.) For that 
OS, you'll need to set the menubar property of the stack to the name of 
the group. You only need to do that once during development. After that, 
whenever the stack comes forward, it's own menubar will replace the 
other one automatically.

Every stack can have its own menubar. If you want no menubar at all on 
Windows it isn't a problem, just don't create one. On Macs, there must 
be something in the system menu; you can't have an empty system menu. 
For Macs, choose one of your menubar groups (from any open stack) and 
set it (once during development) as the defaultMenubar. When you do 
this, the default menu you've set up will display whenever a stack does 
not have its own menubar assigned.

In the IDE, the default menubar belongs to Rev, so you'll see better 
results from this approach if you only set a default menubar in your 
standalone. If you set it during development, you are apt to lose the 
IDE's menubar.

  Can you put just one menu item in the substack and
> get it to add that item to the main menu when that substack is open and then
> when you go to a different substack a different item is added?

You can, but it takes a lot of script tinkering with buttons and 
layering and contents, etc. It's much easier to just duplicate an 
existing menubar, change what's necessary, place it in a stack, and 
assign that as the menubar for the stack.


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list