• 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
Sheets behaving funny
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Intercepting every keystroke
  • Next by Date: Re: Code Completion
  • Previous by thread: Re: Intercepting every keystroke
  • Next by thread: Cocoa/Java - NSNotification not received.
  • Index(es):
    • Date
    • Thread