Re: Goofy NSDrawer behavior
Re: Goofy NSDrawer behavior
- Subject: Re: Goofy NSDrawer behavior
- From: Douglas Davidson <email@hidden>
- Date: Tue, 24 Jul 2001 09:04:36 -0700
On Monday, July 23, 2001, at 05:55 PM, Leslie Orchard wrote:
Actually, now that I look at it, that behavior of the save panel is
precisely what I want, the way it toggles between a small, unresizable
simple window up to a larger, resizable window. And it even remembers
and
tweens between the two states.
I don't suppose you'd know where I might find some sample code on how
the
save panel implements this, would you? I'm imagining there's something
with adding/removing components from their superview and resizing, but I
haven't yet gotten my hands dirty with it...
You may want to look into the NSWindow method setFrame:display:animate:
with the animate option turned on.
From NSWindow.h:
// smooth resize
// subclasses can override animationResizeTime: to control the total
time for the frame change.
// newFrame is the rect passed into setFrame:display:animate:
- (NSTimeInterval)animationResizeTime:(NSRect)newFrame;
// setFrame:display:animate: is equivalent to setFrame:display: if
animateFlag is NO
// If animationFlag is YES, this method will perform a smooth resize of
the window, where the total time for the resize is specified by
-animationResizeTime:
- (void)setFrame:(NSRect)frameRect display:(BOOL)displayFlag
animate:(BOOL)animateFlag;
Douglas Davidson