In Interface Builder, connect the menu item to the two handlers "choose
menu item" and "update menu item".
What you put in the "choose menu item" handler in your script is what
you want to happen when the user chooses the menu item. What needs to
go in the "update menu item" handler is a statement that evaluates to
true or false. If it evaluates to true, the menu item is enabled, if to
false it is disabled. So if you want your menu item to be enabled in
some circumstances but not in others, you need a statement that
evaluates to true or false according to the different circumstances. If
you want your menu item to be enabled all the time, you can simply put
"return true" in the handler.
on update menu item theObject
return true
end update menu item
Philip
On 10 Mar 2005, at 15:10, Ronald Hofmann wrote:
Hi everybody,
I added a new menu item to my MainMenu which I retrieved from the
menues pane.
Unfortunately this item is disabled although I didn´t do anything.
What is the reason for this?
I expected that a menu item is initially enabled.
I tried the following:
set the enabled of (menu item "theNewMenu" of menu "MainMenu" of first
window) to true
Mit freundlichen Grüßen
Prolog Systemberatung
Tel : 08245/904164
Hotline : 08245/966786, Mo-Fr, 9-13Uhr
=======================================