• 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: NSView not resizing when parent view resizes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView not resizing when parent view resizes


  • Subject: Re: NSView not resizing when parent view resizes
  • From: "Louis C. Sacha" <email@hidden>
  • Date: Thu, 9 Dec 2004 05:26:29 -0800

Hello...

NSBox instances use an instance of NSView as a content view, so you probably don't want to directly add your custom view as a subview of the NSBox.


If you want the instance of your NSView custom class to be used as the content view of the NSBox, use


	IBOutlet NSBox *container;

	[container setContentView:yourCustomView];

When it is the content view, your custom view will be automatically resized to fill the box content area whenever necessary.


If you want to place your custom view in the box (but not use it to fill the box as the content view):


	[[container contentView] addSubview:yourCustomView];

In this case, your custom view will be resized (according to whatever autoresize mask you have set) whenever the content view of the NSBox is resized.


Hope that helps,

	Louis



[ container addSubview:view];

In IB, *every*thing is set to be resizable (NSViewHeightSizable | NSViewWithSizable). But when I run the application, the subview (in blue) does not resize. It just sticks to the bottom left corner of the NSBox.

Is this a bug or am I missing a simple point?

Kind regards,
Michael


_______________________________________________ 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
  • Follow-Ups:
    • [SOLVED] Re: NSView not resizing when parent view resizes
      • From: Michael Becker <email@hidden>
References: 
 >NSView not resizing when parent view resizes (From: Michael Becker <email@hidden>)
 >Re: NSView not resizing when parent view resizes (From: Michael Becker <email@hidden>)
 >Re: NSView not resizing when parent view resizes (From: Ricky Sharp <email@hidden>)
 >Re: NSView not resizing when parent view resizes (From: Michael Becker <email@hidden>)
 >Re: NSView not resizing when parent view resizes (From: "John C. Randolph" <email@hidden>)
 >Re: NSView not resizing when parent view resizes (From: Michael Becker <email@hidden>)

  • Prev by Date: Re: NSView not resizing when parent view resizes
  • Next by Date: [SOLVED] Re: NSView not resizing when parent view resizes
  • Previous by thread: Re: NSView not resizing when parent view resizes
  • Next by thread: [SOLVED] Re: NSView not resizing when parent view resizes
  • Index(es):
    • Date
    • Thread