On Mar 27, 2010, at 11:01 AM, Alexander Bokovikov wrote: > Finally, one extra question. When modal window runloop starts? Does it start > after the window is shown on screen or before that? If it starts after window > showing then I'd use performSelector:withObject:afterDelay: to be sure that > my procedure will start to execute itself when window is already visible.
Well, you can show the window yourself, explicitly, before invoking -runModalForWindow:, if you like. Then you can be sure the window is shown before the modal event loop starts. The exact details of -runModalForWindow: are, of course, an implementation detail that is private to the framework, but the documentation for that method says, "[i]t displays the specified window, makes it key, starts the run loop, and processes events for that window." So, I assume it does those things in that order. However, I continue to be confused as to why you care. What's the difference if the procedure starts a fraction of a second before the window is visible or a fraction of a second after? Lastly, if you're going to try to use a -performSelector:... method to schedule something during that event loop, you're going to have to use one which allows you to specify the runloop modes in which it should fire (e.g. -performSelector:withObject:afterDelay:inModes:). Although, as I say, this technique is not necessary if all you're trying to do is show the window first. > Thank you! You're welcome. Cheers, Ken _______________________________________________ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com