• 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: Wed, 8 Dec 2004 11:24:55 +0100

Am 07.12.2004 um 18:30 schrieb Ricky Sharp:
What is happening? How can I make them resize smoothly according to
their superviews?

I know you mentioned that you've called setAutoresizesSubviews:. Have you also called setAutoresizingMask: to set up the appropriate options? Ultimately, all your subviews should be receiving resizeWithOldSuperviewSize: messages. NSView's default implementation of resizeWithOldSuperviewSize: is to use the options set up with setAutoresizingMask:. You can also override resizeWithOldSuperviewSize if you need something custom.

Hm, doesn't work either. Here is a part of my NSView subclass code:

- (unsigned int)autoresizingMask {
	NSLog(@"autoresizingMask");
	return (NSViewWidthSizable | NSViewHeightSizable);
}

- (BOOL)autoresizesSubviews {
	NSLog(@"autoresizesSubviews");
	return YES;
}

- (void)resizeWithOldSuperviewSize:(NSSize)oldBoundsSize {
	NSLog(@"resizeWithOldSuperviewSize");
	[ super resizeWithOldSuperviewSize:oldBoundsSize];
}

Although all the views are set up in IB to be of this custom class, nothing is ever getting logged. I rephrase: These custom views are set up as a subview of another custom view object (which overrides basically only the drawRect: method to make it look fancier). If I resize the window, the "superview" view resizes nicely but these embedded views do not. In IB I have all the sizing options set up correctly, AFAICS.

Cheers,
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: "John C. Randolph" <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>)

  • Prev by Date: Re: What are the numbers the represent the finder window view modes?
  • Next by Date: Re: [OT] Document Icon Templates
  • 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