Skip navigation.
 
mlRe: Beginner NSAlert question
FROM : Uli Kusterer
DATE : Tue Nov 06 23:40:05 2007

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

Related mailsAuthorDate
mlRe: Beginner NSAlert question Keary Suska Nov 6, 17:25
mlBeginner NSAlert question Paul Bruneau Nov 6, 17:29
mlRe: Beginner NSAlert question Paul Bruneau Nov 6, 21:40
mlRe: Beginner NSAlert question David Spooner Nov 6, 22:50
mlRe: Beginner NSAlert question Uli Kusterer Nov 6, 23:40
mlRe: Beginner NSAlert question Paul Bruneau Nov 7, 17:14