• 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
Confusion regarding -worksWhenModal and -setWorksWhenModal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Confusion regarding -worksWhenModal and -setWorksWhenModal


  • Subject: Confusion regarding -worksWhenModal and -setWorksWhenModal
  • From: Glenn Zelniker <email@hidden>
  • Date: Tue, 27 Mar 2007 14:27:26 -0400

I'm trying a simple experiment where I have a simple app whose main window is a subclass of NSPanel and a sheet that I run modally. The main window has a few controls on it and I have overridden the - worksWhenModal method to always return YES. (I also print to the log that -worksWhenModal is getting called). Before I call the - beginSheet... method on the application, I send the panel - setWorksWhenModal:YES. With the sheet now visible and running modally, I click on some of the controls and I can see that - worksWhenModal is getting called, but only sporadically (not with every click). Furthermore, the controls on the underlying panel aren't working. I was under the impression that -setWorksWhenModal would take care of this, but it doesn't seem to. What am I missing?

Just to be complete, I'm trying to come up with a "cheap" way to end a modal sheet by clicking on a control on the app's underlying main window (which is, as described above, a subclass of NSPanel, as per the documentation's recommendation). I realize that I can put a "close" button on the sheet, and that of course works. But it's not what I'm trying to accomplish.

Glenn Zelniker

_______________________________________________

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


  • Prev by Date: Re: making a custom view not grab the keyboard
  • Next by Date: Re: Proper Way to "Unload" a Loaded Nib w/Bindings
  • Previous by thread: Confusion regarding -worksWhenModal and -setWorksWhenModal
  • Next by thread: Re: Cocoa-dev Digest, Vol 4, Issue 303
  • Index(es):
    • Date
    • Thread