Disabling MenuItems

Eric Chatonet eric.chatonet at sosmartsoftware.com
Wed Dec 7 15:33:01 EST 2005


Hi rob,

I don't know exactly your problem :-)
But I have a way to do that sort of things that might interest you:
I  am used to have a "menu template" in a custom property without  
"(" , "!c' and so on.
Each time the menu is called, I use this "ever clean" template and  
add what I need...
I detail this way of doing in a tutorial you will find on my website  
if you need more details.

Best Regards from Paris,
Eric Chatonet.

Le 7 déc. 05 à 21:03, Rob Cozens a écrit :

> Working on Win XP; RunRev 2.6.1,
>
>   if the platform is "MacOS" then
>     enable menuItem 11 of menu 1
>     enable menuItem 13 of menu 1
>   else
>     disable menuItem 11 of menu 1
>     disable menuItem 13 of menu 1
>   end if
>
> does not disable menuItems 11 & 13 until the stack is opened a  
> second time in the Development environment, and _never_ seems to  
> disable them if opened from Rev's Plugins folder.  OTOH,
>
>   if the platform is "MacOS" then
>     enable menuItem 11 of menu 1
>     enable menuItem 13 of menu 1
>   else
>     get the text of button id 1004 -- the first menu button
>     if char 1 of line 11 of it <> "(" then put "(" before line 11  
> of it
>     if char 1 of line 13 of it <> "(" then put "(" before line 13  
> of it
>     set the text of button id 1004 to it
>   end if
>
> works the first time and every time in both circumstances.
>
> Why?  Must I apply a workaround globally?  Eg:
>
> on disableMenuItems menuButtonId, itemList
>   get the text of button id menuButtonId
>   repeat for each line menuItemNumber in itemList
>     if char 1 of line menuItemNumber of it <. "(" then put "("  
> before line menuItemNumber of it
>   end repeat
>   set the text of button id menuButtonId to it
> end disableMenuItems

----------------------------------------------------------------
Web site        http://www.sosmartsoftware.com/
Email        eric.chatonet at sosmartsoftware.com/





More information about the use-livecode mailing list