Re: Resizing Windows
Re: Resizing Windows
- Subject: Re: Resizing Windows
- From: Edwin Zacharias <email@hidden>
- Date: Tue, 14 May 2002 23:26:52 -0400
Another strategy is the save the top left point. Then do your
resizing. Then set it back to the top left point. If your doing any
complex resizing, I have an NSWindow category for converting a frame
rect to a content rect and back for a given window. Email me and I'll
send it to you.
- Edwin
On Tuesday, May 14, 2002, at 11:15 PM, Kyle Wheeler wrote:
Peter Thorson said:
I need to programaticly resize a window. I would like to do this from
teh top left corner not the bottom left.
The way I've always done that is by figuring out the new size of the
window, then finding the difference between the old height and the new
height and moving the window that many pixels in that direction (doing
the
same with horizontal pixels). Then setting the frame is one command
(that
does both) - something like [myWindow setFrame:newframe animate:TRUE];
which makes the window *appear* to the user to be resizing around the
top
left corner.
The key is changing the position of the window at the same time as you
change the size of the window (which can be done in one command). It's
kinda odd to think about at first, but once you get it done, put it in a
wrapper-function and forget about it.
~Kyle
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.