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: "Sean McBride" <email@hidden>
- Date: Thu, 16 Dec 2004 01:50:15 -0500
Andrew White (email@hidden) on Thu, Dec 16, 2004 10:58 PM said:
>> 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
I'm with you so far.
>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.
I don't find this to be the case, but I'm not sure I understand you, or
perhaps you have misunderstood me. It's one of those things that's
easier to see than write about. :) So I've made a simple example and put
it here:
<http://www.cam.org/~cwatson/CocoaTestBed.sitx>
Maybe you could take a quick look?
>Note that you will also need to
>adjust your y axis (vertical) origin if you want your window to slide up
>rather than down.
Agreed.
>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).
Alas, I don't have that book. :(
Thanks for your reply!
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Mac Software Designer Montréal, Québec, Canada
_______________________________________________
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