• 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: Any way to tell why a window is closing?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Any way to tell why a window is closing?


  • Subject: Re: Any way to tell why a window is closing?
  • From: Uli Kusterer <email@hidden>
  • Date: Mon, 21 Sep 2009 17:28:22 +0200


On 21.09.2009, at 17:15, Scott Ribe wrote:

Within -windowWillClose, I need to know whether or not the user clicked the
close button on the window.


Please note: this is not for some crazy un-Mac-like UI idea, it is for
debugging purposes.


For debugging, you could probably walk the view hierarchy of your window (upwards from the content view to its superview etc.) and find the close button widget. Or actually, I vaguely remember there may be an API for getting the close button these days.

Once you have the close button, you could change its action to point to a method of your making, and then from that call the original action.

Cheers,
-- Uli Kusterer
"The witnesses of TeachText are everywhere..."



_______________________________________________

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


References: 
 >Any way to tell why a window is closing? (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: Optimizing Enormous lists in NSBrowser
  • Next by Date: Re: Optimizing Enormous lists in NSBrowser
  • Previous by thread: Any way to tell why a window is closing?
  • Next by thread: Re: Any way to tell why a window is closing?
  • Index(es):
    • Date
    • Thread