I have an empty NSScrollView created with Interface Builder.
And in my code I add, upon a user click, a NSSegmentedControl. For all the next clicks, I add a segment to it.
My problem is that, once I reach the visual limit of NSScrollView, it doesn't start to scroll and all the post-limit segments are never shown.
This is the NSScrollView from Interface Builder :
And here is the method :
- (IBAction)addSegment:(id)sender
{
if (segCtrlColumns == nil) {
segCtrlColumns = [[NSSegmentedControl alloc] initWithFrame:[self.viewColumns frame]]; //self.viewColumns is the NSScrollView from IBOutlet
[segCtrlColumns setSegmentCount:1];
[segCtrlColumns setLabel:@"Test" forSegment:0];
[segCtrlColumns setTarget:self];
} else {
double increaseSegments = [segCtrlColumns segmentCount]+1;
[segCtrlColumns setSegmentCount:increaseSegments];
[segCtrlColumns setLabel:@"Test" forSegment:increaseSegments-1];
}
[self.viewColumns setDocumentView:segCtrlColumns];
}
And here is the problem :
(Well it is more likely "nothing to scroll" than "not scrollable")