• 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
Re: Notification of window visible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Notification of window visible?
      • From: Ken Thomases <email@hidden>
References: 
 >Notification of window visible? (From: Chris Idou <email@hidden>)
 >Re: Notification of window visible? (From: Reinhard Segeler <email@hidden>)
 >Re: Notification of window visible? (From: Chris Idou <email@hidden>)
 >Re: Notification of window visible? (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: PDFSelection question
  • Next by Date: Re: Notification of window visible?
  • Previous by thread: Re: Notification of window visible?
  • Next by thread: Re: Notification of window visible?
  • Index(es):
    • Date
    • Thread