Re: sheet not receiving all events?
Re: sheet not receiving all events?
- Subject: Re: sheet not receiving all events?
- From: Quincey Morris <email@hidden>
- Date: Sat, 17 Sep 2011 12:42:01 -0700
On Sep 17, 2011, at 09:47 , Scott Ribe wrote:
> 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];
To be fair to Torsten, the documentation does indeed say what he says it does, and it does indeed provide the code snippet he quotes, for an application-modal dialog sheet.
Finding this a bit curious, I went to the HIG (referenced by the quoted document) to see what it had to say on the subject. It's a little bit hard to disentangle, but here's what I took away:
a. Terminology: "Dialog" just means a window that accepts input. It could be a sheet or a stand-alone window.
b. For document applications where each document is represented by a single window, a document-modal dialog should be a sheet on the document's window.
c. For document applications where documents may have multiple windows, document modality should be done via an application-modal dialog (non-sheet).
d. For non-document applications, of course, an application-modal dialog is used.
e. An example of a situation where such an application-modal dialog might be a sheet is the case of covering up the application's main window with a sheet that presents a license agreement, to prevent interaction with the application until the agreement is accepted.
Putting all that together, this gives (I think) precisely one scenario where an application-modal dialog sheet should be used:
In a single-window non-document application, if it is necessary to block interaction with the single window, use an application-modal dialog sheet.
"Single-window" is key here.
_______________________________________________
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