Resize Window with fixed ratio
Resize Window with fixed ratio
- Subject: Resize Window with fixed ratio
- From: Lorenzo <email@hidden>
- Date: Fri, 19 Nov 2004 14:23:40 +0100
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.
The method "windowWillResize" is being called all the time during the
resizing, and it proposes integer window size values, so if I calculate the
current ratio here, I end with a different ratio. I need the original ratio,
just when the user clicks on the bottom-right corner of the window.
And the method "windowDidResize" is being called all the time too during the
drag. So I cannot even get the last ratio set.
I have been trying to get the ratio on the mouse down, but the mouseDown
method doesn't detect the mouse clicks on the botton-right corner of the
window. The mouseUp method too.
So, how can I know when the user shouldResize the window?
Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
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