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         |     jac...@hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to