Sheets behaving funny
Sheets behaving funny
- Subject: Sheets behaving funny
- From: spike <email@hidden>
- Date: Thu, 6 Mar 2003 21:34:53 -0500
Hey
I'm working on a program that has the preferences window displayed as a
sheet and I've got some questions about it. I followed the basic
instructions on cocoadevcentral.com for doing it and it works fine the
first time I go to display the sheet, but when I want to display it
again, I run into trouble. The second time it displays, it does the
animation twice, then the entire window (the sheet and the window it's
attached to) disappears. Any ideas?
I'm showing the sheet like this:
[NSApp beginSheet: prefsSheet modalForWindow: window modalDelegate:
self didEndSelector: nil contextInfo: nil];
I'm exiting the sheet like this:
[NSApp endSheet: prefsSheet];
[prefsSheet orderOut: self];
also, from the IBAction that I'm calling to close the sheet, I have my
Ok and my Cancel button calling the same action, how can I know which
button called the action (so I know whether to stick the prefs or not.
I tried this but it didn't work:
if ([[(NSControl*)sender stringValue] compare: @"Ok"] == NSOrderedSame)
{
//blah blah
} else {
//blah blah
}
Thanks.
...spike
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.