• 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
Getting one sheet to open after another
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • RE: Getting one sheet to open after another
      • From: "Christopher Hickman" <email@hidden>
    • Re: Getting one sheet to open after another
      • From: Ian was here <email@hidden>
    • Re: Getting one sheet to open after another
      • From: "Marcus S. Zarra" <email@hidden>
  • Prev by Date: Re: NSString and Unicode and Japanese character encodings
  • Next by Date: Re: How to draw correct underline ?
  • Previous by thread: debugging: see ivars of superclass and in appkit methods
  • Next by thread: Re: Getting one sheet to open after another
  • Index(es):
    • Date
    • Thread