Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

show/hide NSTabView



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.