views:

28

answers:

1

I have this class:

Header:

@interface vcMain : NSWindowController {
    IBOutlet NSView *scroll;
}
@property (retain) IBOutlet NSView *scroll;

-(IBAction)test:(id)sender;

@end

Source:

@implementation vcMain

@synthesize scroll;

-(IBAction)test:(id)sender {
    vItem *item = [[vItem alloc] initWithNibName:@"vItem" bundle:nil];
    NSView *view = [item view];
    [view setFrame:NSMakeRect(0, 0, 300, 600)];
    [view setAutoresizingMask:( NSViewHeightSizable) ];
    [scroll addSubview:view];
}

@end

*scroll is a Custom View in a Bordered Scroll View in the Content View of a Window.

vItem is a ViewController subclass with some things on it to identify its position.

Problem: When resizing my vcMain from the default 300x600 to 150x300, I don't see any scrollbars.

What am I doing wrong?

Tom

A: 

Solved

It was simple, actually. Resizing the view apparently also resized the subview so it wasn't neccessary to show the scrollbars - however, as the elements in the subview didn't move, I didn't notice that the subview was resizing.

Solved by correcting the resizing of the view.