Menu Bar

Kevin Miller kevin at runrev.com
Wed Dec 19 16:55:01 EST 2001


On 15/12/01 8:04 am, John Cuccio <jcuccio at pacbell.net> wrote:

> I have a main stack and sub stacks. I set-up a menubar in the main stack
> with the menu manager. I set the sub stacks to use that menu. What I want to
> do is when a sub stacks open it shows a menu for that stack only.
> 
> If I set all the menus I want to use through the menu manger. then set the
> the button style to stanard. The menu will not show in the menu bar. When i
> want the menu to show I set the style to "menu". But the menu bar does not
> like update. 
> 
> My code.
> In the main stack "Inventory"
> on showmenubar
> -- this will set the menubar for recipe
> lock menus
> set the editmenus of this stack to true
> start editing group "invmenu" of stack "inventory"
> set the style of btn "recipe" of stack "inventory" to "menu"
> stop editing group
> set the editmenus of this stack to false
> unlock menus
> end showmenubar
> 
> I will call this handler before I open the sub stack
> 
> I tried it with just the editmenus then added the start editing group. I can
> tell that it changes the menubar it just does not update the menubar on the
> screen. I still have the old one. If I go to development mode then back to
> browse mose then it shows the correct menubar.

Is the menu bar placed on all cards?  Have you set the defaultMenuBar global
property?  Is the editMenus property of the stack false?  You can set the
contents of a menu simply by running:

put the text of btn "File" into tVar
--edit the contents of tVar
set the text of btn "File" to tVar

To change the menu bar entirely, it is probably simplest to create another
menu group and switch the one in use by the stack.

Kind regards,

Kevin

Kevin Miller <kevin at runrev.com> <http://www.runrev.com/>
Runtime Revolution Limited - Power to the Developer!
Tel: +44 (0) 870 747 1165.  Fax: +44 (0)1639 830 707.




More information about the Use-livecode mailing list