Re: NSView not resizing
Re: NSView not resizing
- Subject: Re: NSView not resizing
- From: j o a r <email@hidden>
- Date: Sat, 14 May 2005 16:43:01 +0200
Please don't cross-post!
On 14 maj 2005, at 00.26, Boisy G. Pitre wrote:
(This method is called by the addSubview method, as stated in the
NSView class documentation.)
Are you sure that the method is called? Check!
I would have thought that setBounds and setFrame are sufficient to
get a view to resize, so Is there something else I should be
doing? Is "didAddSubview" the wrong place to perform this type of
operation?
I would skip the "setBounds:" call, it's probably not something you
need to do.
Add a couple of log statements to see what size is being set.
Something like this:
- (void) didAddSubview:(NSView *) view
{
unsigned int driveCount = [[self subviews] count];
NSRect viewFrame = [view frame];
viewFrame.origin.y = (viewFrame.size.height * (driveCount - 1));
[view setFrameOrigin: viewFrame.origin];
NSRect myFrame = [self frame];
myFrame.size.width = viewFrame.size.width;
myFrame.size.height = (viewFrame.size.height * driveCount);
[self setFrame: myFrame];
NSLog(@"view: %@, frame: %@, my frame: %@", view,
NSStringFromRect([view frame]), NSStringFromRect([self frame]));
}
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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