• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: setFrame:display:animate bottom up instead of top down?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >setFrame:display:animate bottom up instead of top down? (From: Ben Mackin <email@hidden>)

  • Prev by Date: RE: setFrame:display:animate bottom up instead of top down?
  • Next by Date: Icon in NSButton
  • Previous by thread: setFrame:display:animate bottom up instead of top down?
  • Next by thread: Re: converting text input in any encoding to unicode
  • Index(es):
    • Date
    • Thread