Modal window that does not block the main runloop
Modal window that does not block the main runloop
- Subject: Modal window that does not block the main runloop
- From: David Alter <email@hidden>
- Date: Fri, 7 May 2010 10:28:10 -0700
I need to bring a window up that is modal for the application (i.e. you can
not make other windows active, and you can not use menus while this window
is up). However after bringing the modal window up I want control returned
to the main runloop, not a modal runloop.
If I use runModalForWindow: it creates a modal event loop that will not
return until I call endModal. This blocks other code execution, it will not
return control to the application while the modal dialog is up. If I use ...
-
(void)beginSheet:(NSWindow *)sheet modalForWindow:(NSWindow
*)docWindow modalDelegate:(id)modalDelegatedidEndSelector:(SEL)didEndSelector
contextInfo:(void
*)contextInfo
This is closer to the behavior that I want. The window that the sheet is
modal for will not process events, but the main runloop appears to
continue. However other windows can be activated, and I do not want that.
I have been looking at applying different modes to the main runloop. It
looks like it might be a way to achieve what I want to do. I'm not entirely
clear on how this works. Some ideas on this might be helpful.
The reason I want to do it this way is because I'm modifying a Carbon
application with a lot of legacy code. The current code base does it this
way and changing that would require some significant refactoring.
Thank you for the help.
-dave
_______________________________________________
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