• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Resize Window with fixed ratio
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Resize Window with fixed ratio
      • From: Glenn Andreas <email@hidden>
  • Prev by Date: Re: Problem with some clicks not registering in 10.3.6?
  • Next by Date: Potential trick for adding instance variables to classes using poseAs
  • Previous by thread: trying to overload window for keyDown
  • Next by thread: Re: Resize Window with fixed ratio
  • Index(es):
    • Date
    • Thread