Re: setFrame:display:animate bottom up instead of top down?
Re: setFrame:display:animate bottom up instead of top down?
- Subject: Re: setFrame:display:animate bottom up instead of top down?
- From: Quentin Mathé <email@hidden>
- Date: Mon, 28 Apr 2003 01:43:12 +0200
Le dimanche, 27 avr 2003, ` 23:54 Europe/Paris, Ben Mackin a icrit :
I am trying to resize my pref window, similar to how mail does it. So
that
the window nicely fits around each views settings. I found
setFrame:display:animate: and it seemed like exactly what I needed.
However,
it seems to resize the window form the top down, not the bottom up
(like
what I want). Maybe I have something wrong, but here is a snipit:
(The window right now is 520 pixels tall)
NSSize mySize = [prefWindow frame].size;
NSPoint myPoint = [prefWindow frame].origin;
[prefWindow setFrame:NSMakeRect(myPoint.x, myPoint.y, mySize.width,
432)
display:YES animate:YES ];
Is this not the right function? I didn't see anything else (there was
setContentSize: but it did the same thing) Any help is appreciated.
It's the right function and it's normal because the coordinate system
with Cocoa is left down based.
Just use something like :
NSSize mySize = [prefWindow frame].size;
NSPoint myPoint = [prefWindow frame].origin;
int heightAdjustement = mySize.height - 432;
[prefWindow setFrame:NSMakeRect(myPoint.x, myPoint.y +
heightAdjustement, mySize.width, 432)
display:YES animate:YES ];
--
Quentin Mathi
email@hidden
_______________________________________________
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.