• 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
How to keep a subview centered - autoresizing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to keep a subview centered - autoresizing


  • Subject: How to keep a subview centered - autoresizing
  • From: Dan Bernstein <email@hidden>
  • Date: Fri, 8 Feb 2002 17:16:49 +0200

I have a view which is initially centered in its superview (which is an NSWindow's contentView) with its autoresizingMask set to NSViewMinXMargin | NSViewMinXMargin (i.e. springs to the left and to the right). When the user drags the window wider, the initially-centered view starts drifting to the left (apparently if the resize amount is odd, then the extra pixel is always added to the right margin). What's the Right Thing to Do if I want the view to remain centered at all times? I suppose I can call -[NSWindow setResizeIncrements:] with even increments. Any better ideas?

TIA,
-- Dan Bernstein
_______________________________________________
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.

  • Prev by Date: Final (cleanup) drawing event?
  • Next by Date: Modal Window in IB
  • Previous by thread: Re: Final (cleanup) drawing event?
  • Next by thread: Re: How to keep a subview centered - autoresizing
  • Index(es):
    • Date
    • Thread