enable and disable submenu items

Martin Koob mkoob at rogers.com
Thu Jan 22 14:42:47 EST 2009


After more testing I realize what is going on.  The 'enable menuitem'
command places the '(' at the begining of the line that contains the
submenu before the tab which makes it no longer a sub menu.  If you
disable a sub menu from the Menu Builder it correctly places the '('
after the tab and in front of the menuitem's text.

I can get it to work correctly by changing the line in the menu item ie.

put 3 into itemnumber 
put "from target..." into itemtext

if menuaction is "enable" then 
   --enable submenu item 
   put tab &  Itemtext into line  itemnumber of button "File" 
else 
   --disable submenu item 
   put  tab & "(" & Itemtext into line  itemnumber of button "File" 
end if

Doing this will get the correct behavior.  However it would be better if
enable menuitem could handle this.

Martin




More information about the use-livecode mailing list