Re: Notification of window visible?
Re: Notification of window visible?
- Subject: Re: Notification of window visible?
- From: Jens Alfke <email@hidden>
- Date: Mon, 7 Jun 2010 12:58:36 -0700
On Jun 7, 2010, at 3:31 AM, Ken Thomases wrote:
> Why do you need such a notification? Windows don't "spontaneously" become visible unbeknownst to your code.
I’ve run into this in an app that has a singleton panel, which I want to persistently remember whether it’s open or closed. In other words, I want to update a boolean user-default when the window opens or closes. But the panel is in the main nib, with the “Show Panel" menu command simply wired up to its -makeKeyAndOrderFront: method. So the window was indeed becoming spontaneously visible without my code being called.
I found it was possible to detect closing via a notification, but not opening. I ended up writing a custom -showMyPanel: method, wiring the menu to that, and having that method set the default. Not a big deal, but it would have been cleaner if there’d just been a window-did-become-visible notification to listen to.
—Jens_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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