Re: Saving a borderless window frame to user defaults
Re: Saving a borderless window frame to user defaults
- Subject: Re: Saving a borderless window frame to user defaults
- From: Hank Heijink <email@hidden>
- Date: Mon, 2 Jul 2007 10:48:55 -0400
I should have guessed this - I set up the borderless window as
resizable in Interface Builder, but then I subclassed it, overriding
the init method with NSBorderlessWindowMask for a styleMask.
This, of course, makes the window non-resizable and explains why -
[setFrameUsingName] didn't work. I needed -[setFrameUsingName:force:]
with force set to YES. Duh.
Thanks, Matt!
On Jun 30, 2007, at 11:51 AM, Matt Neuburg wrote:
On Thu, 28 Jun 2007 13:27:55 -0400, Hank Heijink
<email@hidden>
said:
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.
So it *does* keep the size. The window frame is correctly written
into the
defaults. The problem is merely that when you start up the
application the
next time, that window frame is not being applied to the window. Is
that
correct? If so, it should be possible to fetch the window frame
information
out of the defaults and then apply it to the window yourself, as the
application starts up. Could that work?
m.
--
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)
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