Re: elegant sheet cascade handling?
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