FROM : Torsten Curdt
DATE : Wed May 14 20:42:49 2008
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
DATE : Wed May 14 20:42:49 2008
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
| Related mails | Author | Date |
|---|---|---|
| Torsten Curdt | May 14, 20:42 | |
| Torsten Curdt | May 15, 01:27 | |
| David Dumaresq | May 15, 01:38 | |
| Torsten Curdt | May 15, 02:15 |






Cocoa mail archive

