Re: sheet not receiving all events?
Re: sheet not receiving all events?
- Subject: Re: sheet not receiving all events?
- From: Scott Ribe <email@hidden>
- Date: Sat, 17 Sep 2011 10:47:57 -0600
On Sep 17, 2011, at 10:25 AM, Torsten Curdt wrote:
> You are suggesting that this is not OK?
Holy cow that's bad! Sheets are supposed to be document modal, not application modal. So it's wrong right there.
Next, you don't have to display the window before [NSApp runModalForWindow:], because the runModalForWindow will display the window, order it front, make it key, etc.
Next, you don't have to order the window out either, because [NSApp stopModal] will take care of that.
The last 2 points of course are assuming you're doing it normally, not trying to make it a sheet & application modal at the same time.
In other words, to display a modal dialog, this works:
DebugReportTests_WC *wc = [[DebugReportTests_WC alloc]
initWithWindowNibName: @"DebugReportTests"];
[NSApp runModalForWindow: [wc window]];
[wc autorelease];
And to get rid of it in response to a cancel button, this works:
[NSApp stopModal];
Of course if you want a document-modal sheet, that's a different question--ask it if you need to ;-)
--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice
_______________________________________________
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