Saving a borderless window frame to user defaults
Saving a borderless window frame to user defaults
- Subject: Saving a borderless window frame to user defaults
- From: Hank Heijink <email@hidden>
- Date: Thu, 28 Jun 2007 13:27:55 -0400
Hi all,
I have a borderless window (adapted from Apple's borderless window
example) that I want to save the window frame of in the user
defaults. I've given it an auto save name in Interface Builder, and
that works fine except for one thing: it saves the origin of the
window frame rectangle, but it doesn't keep the size. I've been
experimenting, and it turns out that the correct rectangle is saved
to the user defaults, but somehow the size gets overridden by the
size set in interface builder somewhere between calling -
initWithContent:etc.etc. and the actual drawing of the window.
I've subclassed NSWindow, but the only thing I overrode is the
initWithContent method (plus mouseDown and mouseDragged for moving
and resizing):
- (id)initWithContentRect:(NSRect)contentRect
styleMask:(unsigned int)aStyle
backing:(NSBackingStoreType)bufferingType
defer:(BOOL)flag {
NSWindow* result = [super initWithContentRect:contentRect
styleMask:NSBorderlessWindowMask
backing:bufferingType
defer:flag];
return result;
}
Now, if I change the styleMask back to aStyle, the size is retained
correctly. I've been searching around, but I can't find anything
about this. Is there something about borderless windows I'm not getting?
Thanks for any help!
Hank
_______________________________________________
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