Re: NSScrollView's non-scrollbar section
Re: NSScrollView's non-scrollbar section
- Subject: Re: NSScrollView's non-scrollbar section
- From: Jim Correia <email@hidden>
- Date: Fri, 9 Nov 2001 23:25:19 -0500
At 8:07 PM -0800 11/9/01, Sam Goldman wrote:
Here's the code that I am using right now to position the views:
NSScrollView *myScrollView = [[NSScrollView alloc] initWithFrame:[[[tabView
tabViewItemAtIndex:0] view] bounds]];
NSTextView *myTextView = [[NSTextView alloc] initWithFrame:[myScrollView
bounds]];
[myScrollView setHasVerticalScroller:YES];
[myTextView setAutoresizingMask:18];
[myScrollView setAutoresizingMask:18];
[[tabView tabViewItemAtIndex:0] setView:myScrollView];
[myScrollView setDocumentView:myTextView];
Does this make sense to anyone. While positioning in IB would be better and
easier, it is not an option.
You aren't calculating the correct view bounds.
<
http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSScrollView.html#//apple_ref/occ/clm/NSScrollView/contentSizeForFrameSize:hasHorizontalScroller:hasVerticalScroller:borderType:>
Jim