Contextual menus not working in modal windows?
Contextual menus not working in modal windows?
- Subject: Contextual menus not working in modal windows?
- From: Tim Hewett <email@hidden>
- Date: Thu, 24 Jun 2004 13:25:45 +0100
Hi,
I've been trying to add a contextual menu to a NSTableView in
a modal custom dialog panel but can't get it to do anything.
Each menu item's target and action selector are correct as I've
had awakeFromNib print them out and all is correct. However
if the NSMenu uses the menu item autoenabling mechanism,
the validateMenuItem: selector is never called, and if autoenabling
is disabled so that the menu items are enabled by default,
selecting the menu item does not cause the action to be called
on the target even though both are definitely setup correctly
(using IB) - nothing happens when the menu item is selected.
As a test, a menu was setup on one of the app's (non- modal) main
window views, and it called its action perfectly, yet when the same
was tried on any of the app's modal dialogs the menus just
wouldn't work. The non-modal windows already have quite a
collection of contextual menus, all autoenabling and calling
the relevant methods correctly, but it just seems to be a total
no-go for modal dialogs.
Do you have to do something special to get contextual menus
to work in modal windows, or maybe this is a bug? If so, is there
a known workaround? I've been trying to think of an existing app
which uses menus in modal dialogs but one hasn't occurred to
me yet, maybe this is the reason why.
The irony is this: because under 10.2.8 buttons don't work when
they are in a drawer attached to a modal window (they just cause
a system beep), a "don't tell me this again" dialog was going to be
added to tell users to use a contextual menu instead. But those
menus don't seem to work in modal dialogs either, whether or not
they are in a drawer, and now this is the case for 10.3.4 as well
as 10.2.8... Nurse, can I go for a walk now?
Regards,
Tim Hewett,
Coolatoola.com
_______________________________________________
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.