• 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: elegant sheet cascade handling?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: elegant sheet cascade handling?


  • Subject: Re: elegant sheet cascade handling?
  • From: Keith Duncan <email@hidden>
  • Date: Wed, 11 Apr 2007 18:11:55 +0100

but of course this means it can't so simply be all in one
method, because as soon as you show a sheet you have to fall out of the
current method. (That is why I started by developing the app usign modal
alerts.)

Unless I'm much mistaken this is what you're looking for. You can run your sheets modally in a single method, I do it all the time to avoid having to imp an didEndSelector. An example of the code I use is below.


- (NSString *)userSpecifiedLibraryFile {
[NSApp beginSheet:librarySheet modalForWindow:[NSApp mainWindow] modalDelegate:self didEndSelector:nil contextInfo:nil];
[NSApp runModalForWindow:librarySheet]; // This line here is what you're looking for


    // The sheet is up here

    [NSApp endSheet:librarySheet];
    [librarySheet orderOut:self];

// Continue working

return [NSString stringWithString:[libraryPositionField stringValue]];
}


You'll need some way to stop the modal sheet, I typically have a method like -

- (IBAction)endLibrarySheet:(id)sender {
	[NSApp stopModal];
}

You can have the all the buttons which end your various sheets point to this method.

- Keith
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: elegant sheet cascade handling?
      • From: Matt Neuburg <email@hidden>
References: 
 >elegant sheet cascade handling? (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: WM_KEYDOWN
  • Next by Date: Re: WM_KEYDOWN
  • Previous by thread: Re: elegant sheet cascade handling?
  • Next by thread: Re: elegant sheet cascade handling?
  • Index(es):
    • Date
    • Thread