Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: menu is disabled



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
=======================================
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden
References: 
 >menu is disabled (From: Ronald Hofmann <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.