• 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: Michael Becker <email@hidden>
  • Date: Thu, 9 Dec 2004 11:52:10 +0100

Am 08.12.2004 um 19:02 schrieb John C. Randolph:
I would just send it a "setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)" message.

Doesn't work either. I've set up a sample app which has a "container" view (NSBox) and a "child" view (NSView). Actually, I overrode NSView to paint the view in blue so I could see whether it resizes. Here is the complete code of the project:


In AppController:

- (void)awakeFromNib {
	[ view setAutoresizingMask:(NSViewHeightSizable | NSViewWidthSizable)];
	[ container addSubview:view];
}

In the NSView subclass:

- (void)drawRect:(NSRect)rect {
	[[NSColor blueColor] set];
	NSRectFill([self frame]);
	[super drawRect:rect];
}

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:
    • Re: NSView not resizing when parent view resizes
      • From: "Louis C. Sacha" <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>)

  • Prev by Date: Re: How to create a button dynamically and set action in subclass
  • Next by Date: Re: NSView not resizing when parent view resizes
  • Previous by thread: Re: NSView not resizing when parent view resizes
  • Next by thread: Re: NSView not resizing when parent view resizes
  • Index(es):
    • Date
    • Thread