Getting one sheet to open after another
Getting one sheet to open after another
- Subject: Getting one sheet to open after another
- From: Ben Borofka <email@hidden>
- Date: Thu, 25 Aug 2005 16:39:18 -0700
I have a single-window app that requires (at most) two decisions from
the user via sheets. I am having troubles when I need to display two
sheets to the user. How do I get the second sheet to wait for the
first sheet to dismiss before rolling down?
Here are my functions:
//sheet 1
NSBeginCriticalAlertSheet(@"Do you want to create another Passgen
account on this computer?",
@"Create Another",
@"Cancel",
nil,
mainWindow,
self,
@selector(sheetDidEndLocal:returnCode:contextInfo:),
nil,
nil,
@"The account \"%s\" has already been created with Passgen
on this computer.",
[alreadyGeneratedAccountUsername bytes]);
//sheet 2, runs in a different method
NSBeginCriticalAlertSheet(@"This account already exists in the
Passgen database. Do you want to overwrite it?",
@"Overwrite",
@"Cancel",
nil,
mainWindow,
self,
@selector(sheetDidEndDatabase:returnCode:contextInfo:),
nil,
nil,
@"The account \"%@\" will be overwritten.",
[thisMac stateID]);
When sheet 1 rolls down, the app continues to run and the second sheet
rolls down behind it. Once I dismiss the first sheet, the main window
dissappears and all I see is sheet 2.
I've tried using NSLock to lock sections of the code before the 2nd
sheet rolls down, but it doesn't seem to help.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden