• 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: Beginner NSAlert question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Beginner NSAlert question


  • Subject: Re: Beginner NSAlert question
  • From: Uli Kusterer <email@hidden>
  • Date: Tue, 6 Nov 2007 23:40:05 +0100

Am 06.11.2007 um 17:25 schrieb Keary Suska:
because the sheet starts an event loop, you need a callback method to return control to the caller.


 Err... I think you swapped some words there:

A *modal panel* starts its own nested event loop, and handles events in its one window until someone clicks OK or cancel. This effectively blocks the whole application (at least from the user's point of view).

A sheet *doesn't* start an event loop. If you create a sheet, it is simply a window that you created. All its events are handled on the main event loop like for other windows. All it does is block (most) events coming to the window on which you show the sheet. So, a user can not use the window on which the sheet is, but all other windows in the application.

Since creating a sheet returns immediately, and doesn't block the app, you need another way to detect when the sheet's buttons have been clicked. This is what the didEndSelector: on the default sheets is for.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de



_______________________________________________

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: 
 >Re: Beginner NSAlert question (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: Enabling cut and paste in modal window
  • Next by Date: Re: NSBrowser tooltips (Tiger and Leopard)
  • Previous by thread: Re: Beginner NSAlert question
  • Next by thread: Garbage Collection in 10.4
  • Index(es):
    • Date
    • Thread