Problem with validateMenuItem and a Modal Dialog, maybe a bug in Cocoa...
Problem with validateMenuItem and a Modal Dialog, maybe a bug in Cocoa...
- Subject: Problem with validateMenuItem and a Modal Dialog, maybe a bug in Cocoa...
- From: Stéphane Sudre <email@hidden>
- Date: Wed, 22 Jan 2003 14:58:28 +0100
According to the Cocoa documentation:
validateMenuItem:
- (BOOL)validateMenuItem:(id <NSMenuItem>)menuItem
Implemented to override the default action of enabling or disabling
menuItem. The object implementing this method must be the target of
menuItem. It returns YES to enable menuItem, NO to disable it. You can
determine which menu item menuItem is by querying it for its title,
tag, or action.
----------------------------
This is working fine in the main window of my application.
o Now I have a NSTextField subclass instance in a NSPanel run as a
Modal dialog.
o There is a NSMenu attached to this NSTextField subclass instance. (to
the menu outlet)
o In this NSMenu, there's a NSMenuItem whose target is my NSPanel
controller.
o The NSPanel control implements the - (BOOL)validateMenuItem:(id
<NSMenuItem>)menuItem method.
When the NSMenu attached to the NSTextField subclass is displayed (via
a simple click), all its items are disabled and the validateMenuItem:
method is not called.
When I click on a NSPopUpButton item in this same NSPanel, the
validateMenuItem: method is called.
I checked at awakeFromNib and indeed the target and action of the
NSMenuItems of the NSMenu attached to the NSTextField subclass instance
are correct.
Is there some kind of magic to have validateMenuItem: be called for my
NSTextField subclass instance or do I just need to fill a bug report?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.