• 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
hey, who's enabling my window's close button?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

hey, who's enabling my window's close button?


  • Subject: hey, who's enabling my window's close button?
  • From: Matt Neuburg <email@hidden>
  • Date: Thu, 12 Apr 2007 11:26:48 -0700
  • Thread-topic: hey, who's enabling my window's close button?

Because of certain quirks of Interface Builder's assumptions about windows,
my window's awakeFromNib: calls

[[window standardWindowButton:NSWindowCloseButton] setEnabled:NO];

However, I've just started putting NSAlert sheets up in front of my window,
and now I discover that when a sheet closes, the close button is enabled
again! I can counteract this by calling setEnabled:NO again, every time, but
shouldn't this behavior count as a bug? m.

PS Okay, you might ask, what quirks? Well, I want a utility window with a
Minimize button but no Close button. But if you specify no Close button for
utiity window in Interface Builder, you get no buttons at all (including no
Minimize button)! I regard this as a bug too (or at least kind of wacky). So
to work around this, I specify if Interface Builder that I *do* want a Close
button, and then I disable it in awakeFromNib.

PPS If your reaction is, "Well you shouldn't be putting a sheet in front of
a utility window," please, let's not go there.

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>



_______________________________________________

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

  • Follow-Ups:
    • Re: hey, who's enabling my window's close button?
      • From: b UND d <email@hidden>
    • Re: hey, who's enabling my window's close button?
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: Can a value transformer get its own registration name?
  • Next by Date: Re: Can a value transformer get its own registration name?
  • Previous by thread: Re: Utility Panel and AppleScriptKit.framework issue
  • Next by thread: Re: hey, who's enabling my window's close button?
  • Index(es):
    • Date
    • Thread