How to add NSScrollView automatically?
How to add NSScrollView automatically?
- Subject: How to add NSScrollView automatically?
- From: Michael Becker <email@hidden>
- Date: Fri, 9 Apr 2004 21:43:13 +0200
Hi!
Damn, I cannot figure out why this is not working. Here's the thing: I
am setting up an NSTabView programmatically. Each NSTabViewItem will
contain a ScrollView which will contain a custom view.
Doing this works perfectly:
[ tabViewItem setView:myCustomView];
However, when I try to put myCustomView in a ScrollView/ClipView-pair,
it doesn't work:
NSClipView *clip = [[ NSClipView alloc]
initWithFrame:NSMakeRect(0,0,300,300)];
NSScrollView *scroll = [[ NSScrollView alloc]
initWithFrame:NSMakeRect(0,0,400,400)];
[ scroll setBorderType:NSBezelBorder];
[ scroll setHasVerticalScroller:YES];
[ scroll setContentView:clip];
[ scroll setDocumentView:cart];
NSTabViewItem *item = [[ NSTabViewItem alloc]
initWithIdentifier:@"something"];
[ item setView:scroll];
The ScrollView gets displayed, also the vertical scroller, but
myCustomView does not. What is wrong here?
Also are those NSMakeRect()'s providing dummy-information, since the
TabViewItem seems to fit its view to its bounds (which is what I want).
Will the ClipView also be sized to fit the ScrollView?
Bye,
Michael
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.