Re: Resize Window with fixed ratio
Re: Resize Window with fixed ratio
- Subject: Re: Resize Window with fixed ratio
- From: Glenn Andreas <email@hidden>
- Date: Fri, 19 Nov 2004 09:10:06 -0600
Hi,
I am trying to resize a window (by dragging the bottom-right corner) and
force the window to have a fixed ratio (height / width).
I am using the "windowWillResize" method but it doesn't fit my needs.
I need to set the ratio just "before" the resizing begins, so if the user
hold down the Shift key, he resizes the window proportionally; otherwise he
resizes the window with custom size.
The problem is that I cannot find any method like "windowShouldResize" and I
cannot get the ratio before the resizing begins.
IIRC, if you grab the content rect of the window in windowWillResize,
it will be the size that the window currently is before it is resized
(so you can use the ratio of the current size if the shift key is
down).
Also, don't forget that frameRect != contentRect (and when
constraining, you usually want the content to be constrained, and not
the frame), so contentRectForFrameRect:/frameRectForContentRect are
your friends
--
Glenn Andreas email@hidden
<http://www.gandreas.com/> oh my!
Mad, Bad, and Dangerous to Know
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden