Re: Strange results when resizing window
Re: Strange results when resizing window
- Subject: Re: Strange results when resizing window
- From: Shawn Erickson <email@hidden>
- Date: Fri, 14 Jan 2005 12:34:04 -0800
On Jan 14, 2005, at 12:13 PM, Austin Sarner wrote:
Hey,
I have a preferences style window that uses a toolbar for switching between panes in a tab view. This works fine, but I tried to implement resizing - and it resizes, but in a very odd way. It resizes everything from the bottom as opposed to the top. If anyone could point me in the right direction (I have messed with the origin of the nsrect but with no success). I'm looking for resizing similar to that in the preferences of mail.app. Thanks a bunch and if its something really simple then please excuse my ignorance ;).
NSRect myRect;
myRect = [mainWindow frame];
myRect.size.width = 546;
myRect.size.height = 301 + toolbarHeight;
[mainWindow setFrame:myRect display:YES animate:YES];
Note in Cocoa and Quartz2D the origin for window and view coords, etc. is normally the lower left corner not the upper left corner. In other words the origin for the window is the lower left corner and increasing heigh doesn't change this origin but the window bounds which in this case grows it vertically up the screen.
So you need to modify not only the height but also y.
-Shawn
_______________________________________________
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