Re: Controlling control sizes when programatically resizing a window
Re: Controlling control sizes when programatically resizing a window
- Subject: Re: Controlling control sizes when programatically resizing a window
- From: Andrew White <email@hidden>
- Date: Thu, 16 Dec 2004 14:58:41 +1100
Sean McBride wrote:
Hi all,
I have a window with some controls on the bottom. At a certain point, I
need to remove these controls and make the window slightly shorter so
there is no empty space where the controls were.
I figured out how to remove the controls and resize the window. But the
gap is not disappearing, instead the tableview (top of window) is
becoming shorter. I suspect this has something to do with the autosizing
(springs in IB), but I'm not sure.
For some reason, Cocoa objects have their origin at the bottom left (rather
than top left, which IMO would be more sensible). So, when you resize the
window, it shrinks from the top and/or right, thus the observed behaviour.
You will probably find that locking the springs to the top of your window
and leaving them floating at the bottom means that when the window resizes
the objects all shuffle down correctly. Note that you will also need to
adjust your y axis (vertical) origin if you want your window to slide up
rather than down.
There is an example of this behaviour on pg 240-241 of O'Reilly's "Building
Cocoa Applications" (Garfinkel & Mahoney, ISBN: 0-596-00235-1).
--
Andrew White
_______________________________________________
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