Re: runModalForWindow is disabling my menus
Re: runModalForWindow is disabling my menus
- Subject: Re: runModalForWindow is disabling my menus
- From: "Pascal J. Bourguignon" <email@hidden>
- Date: Sat, 05 Sep 2015 20:12:01 +0200
- Organization: Informatimago
On 05/09/15 18:39, Felipe Monteiro de Carvalho wrote:
On Sat, Sep 5, 2015 at 3:45 PM, Pascal J. Bourguignon
<email@hidden> wrote:
AFAIK, it's on purpose. Definitely in the case of an application modal
dialog.
In the case of a window modal dialog, you can switch to another window, and
then have access to the menubar, but within the context of the window modal
dialog, you the menus are disabled.
I know, but I thought there might be some workaround...
In my case it is an application modal dialog.
And I cannot change this because its not really an application that I
am writing, it is a cross-platform framework, and some people use the
framework to write apps which have application modal dialogs that have
menus...
My only idea so far is to just show the window normally, not using
runModalForWindow, and then manually in each event handler for other
windows check if there is a modal window and if there is, drop the
event. But its a lot of work to change *all* event handlers, while I
am satisfied with runModalForWindow so far, only the menus don't work.
I would try the following: have a subclass of NSWindow with a mouseDown:
method that will detect when the click is on the menu bar, and in that
case, skip the superclass, and the nextResponder chain, and go directly
to [[NSApplication sharedApplication] mouseDown:event] (since there's
no API to process mouseDown: events on a NSMenu).
--
__Pascal J. Bourguignon__
http://www.informatimago.com/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden