Re: hey, who's enabling my window's close button?
Re: hey, who's enabling my window's close button?
- Subject: Re: hey, who's enabling my window's close button?
- From: Keary Suska <email@hidden>
- Date: Thu, 12 Apr 2007 17:32:17 -0600
- Thread-topic: hey, who's enabling my window's close button?
on 4/12/07 12:26 PM, email@hidden purportedly said:
> 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.
My hunch is that title bar widget button states are determined by the window
style mask. Unfortunately, it is set when the window is initialized and
cannot be changed thereafter. But I wonder if something screwy is going on:
AFAIK, utility panels are not supposed to be miniaturizable, so the
corresponding button should always be disabled. Are you using a standard
NSPanel in IB, and then setting the other options via code?
> 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.
I was curious about this, and I can't replicate the behavior you are
describing (newest Xcode 2,4/Tiger). The miniaturize button is always
disabled, as is the case for utility windows, but I can disable the close
button, and the zoom button still works, and visa versa. May be your nib is
corrupt? Or perhaps Cocoa is doing some HIG-enforcement on the back end...
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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