What property does "set as stack menubar" set?

J. Landman Gay jacque at hyperactivesw.com
Sun Mar 15 15:50:09 EDT 2015


On 3/15/2015 8:12 AM, Dr. Hawkins wrote:
> put the editMenus of stack out0, the vis of grp stk_menu of stack out0, the
> menubar of stack out0
>
> yields
> fase, true,
>
> I clone stack out0, name it to out 1, and the menu now appears on the card.

Is it really on the card, or just in the system menu bar? The result of 
your "put" statement says there is no menubar assigned to that stack 
(the last item is empty.) Do you see the group in the App Browser when 
you look at that card?

>
> OK, I found it.  in my setMenus handler, I have
>
> set the menuBar of stack otWnNm to the long id of  group "stk_menu" of
> stack otWnNm
>
> (sometimes set only for macos)

You've assigned a menu from a different stack. This does not copy the 
group, it just loads that menu into the Mac system menu bar. On Windows 
there will be no menus because the group isn't placed on that card.

>
> This line is making the group visible, but checking editMenus shows that it
> is still false.

This is confusing. If there is no physical group placed on that card, 
nothing should show. If you mean the menus are in the system menu bar, 
then it makes sense; the menus are being loaded from a group on a 
different stack, which is only possible on a Mac.

I think you're making this too hard. Create the menu group in Out0, set 
its backgroundBehavior to true, and place it on every card in that 
stack. Set the menubar of Out0 to the short name of the group. You don't 
need to script anything else for menu setup, just do this once during 
development. When you clone the stack it should just work. Unless you 
are changing the content of the menu buttons dynamically, you won't need 
a setMenus handler.

The state of editMenus is not saved with the stack, it will change to 
its default of false on a Mac and true on Windows on each launch. So you 
don't really need to worry about that in the final app, it's a 
development tool.

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




More information about the use-livecode mailing list