show/hide NSTabView
show/hide NSTabView
- Subject: show/hide NSTabView
- From: Torsten Curdt <email@hidden>
- Date: Wed, 14 May 2008 20:42:49 +0200
While the code below seemed to have worked OK for showing/hiding a
NSTextView I am now not really sure what's going on when using it on a
NSTabView.
- (void) showDetails:(BOOL)show animate:(BOOL)animate
{
NSSize fullSize = NSMakeSize(455, 302);
NSRect windowFrame = [[self window] frame];
if (show) {
[tabView setFrameSize:fullSize];
[tabView setNeedsDisplay:YES];
windowFrame.origin.y -= fullSize.height;
windowFrame.size.height += fullSize.height;
[[self window] setFrame: windowFrame
display: YES
animate: animate];
} else {
[tabView setFrameSize:NSMakeSize(0,0)];
[tabView setNeedsDisplay:YES];
windowFrame.origin.y += fullSize.height;
windowFrame.size.height -= fullSize.height;
[[self window] setFrame: windowFrame
display: YES
animate: animate];
}
NSRect tabFrame = [tabView frame];
NSLog(@"(%f,%f) (%fx%f)", tabFrame.origin.x,
tabFrame.origin.y, tabFrame.size.width, tabFrame.size.height);
}
While hiding works just fine ...when shown again the tabFrame height
turns out to be 604 ...so double of what I was setting.
Now I thought that this might be related to the "autoresize subviews"
setting in IB. But for whatever reason I cannot unset it.
I save it and when I open the NIB in IB again ...it's back checked.
What's going on?
cheers
--
Torsten
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden