• 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
Re: Resize Window with fixed ratio
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Resize Window with fixed ratio
      • From: Lorenzo <email@hidden>
References: 
 >Resize Window with fixed ratio (From: Lorenzo <email@hidden>)

  • Prev by Date: Re: contextual menu for a NSTableView
  • Next by Date: Re: Fastest way to push strings to the screen in an NSView?
  • Previous by thread: Resize Window with fixed ratio
  • Next by thread: Re: Resize Window with fixed ratio
  • Index(es):
    • Date
    • Thread