On 05/09/15 18:39, Felipe Monteiro de Carvalho wrote:
On Sat, Sep 5, 2015 at 3:45 PM, Pascal J. Bourguignon
<p...@informatimago.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to