Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Problems with runModalForWindow, looking for alternatives
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with runModalForWindow, looking for alternatives



On Oct 31, 2011, at 6:00 PM, Vojtěch Meluzín wrote:

> I tried using runModalForWindow, but found following problems:
> 1) The method seems to release the window or something. If I don't call
> [NSWindow retain] before calling it, further calls lead to a crash.
> Therefore I cannot show subwindows.
> 2) It doesn't show and activate the window - in most cases the window
> appears in the background.
> 3) It cannot change cursor - [NSCursor set] does nothing.

I think you need to show us the code you use to run the window.

> 4) The documentation says nothing about the problems above, but it states
> the processing stops any other processing in other windows, including
> timers, that's not a good idea.


It puts the runloop into a different mode, and blocks user events aimed at other windows, which sounds like what you want. Whether timers run depends on what runloop modes they were registered with; but there are plenty of other cases where modal windows are run, so the host app has probably had to deal with those before.

—Jens_______________________________________________

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

References: 
 >Problems with runModalForWindow, looking for alternatives (From: Vojtěch Meluzín <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.