• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: sheet not receiving all events?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: sheet not receiving all events?
      • From: Quincey Morris <email@hidden>
References: 
 >sheet not receiving all events? (From: Torsten Curdt <email@hidden>)
 >Re: sheet not receiving all events? (From: Jens Alfke <email@hidden>)
 >Re: sheet not receiving all events? (From: Torsten Curdt <email@hidden>)
 >Re: sheet not receiving all events? (From: Scott Ribe <email@hidden>)
 >Re: sheet not receiving all events? (From: Torsten Curdt <email@hidden>)
 >Re: sheet not receiving all events? (From: Scott Ribe <email@hidden>)
 >Re: sheet not receiving all events? (From: Torsten Curdt <email@hidden>)

  • Prev by Date: Re: sheet not receiving all events?
  • Next by Date: Re: sheet not receiving all events?
  • Previous by thread: Re: sheet not receiving all events?
  • Next by thread: Re: sheet not receiving all events?
  • Index(es):
    • Date
    • Thread