hey, who's enabling my window's close button?
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