NSScrollView strange behaviour
NSScrollView strange behaviour
- Subject: NSScrollView strange behaviour
- From: Wezzy2k <email@hidden>
- Date: Sat, 18 Oct 2003 02:24:29 +0200
Hi i'm fighting with NSScrollView! now my NSTextView subclass can grows
outside the NSScrollView frame and the scrollbars are activated, but
while writing into the subclass the scroller doesn't follow the cursor!
Scrollers doesn't recognize return character and i go outside the
visible area, but, if i press an arrow, the scrollers immidiatly shows
the line with cursor.
Some ideas ?
This is the code that initialize my subclass, SourceViewer is my
NSTextView subclass and tabView is an outlet to a NSTabView istance
SourceViewer * sr2;
NSTabViewItem * item;
NSScrollView * scroller;
//Create the TabItem
item = [[NSTabViewItem alloc] initWithIdentifier:@""];
//Set the label
[item setLabel:title];
//Create the Scroller
scroller = [[NSScrollView alloc] initWithFrame:[tabView contentRect]];
//Set some Scroller proprieties
[scroller setBorderType:NSBezelBorder];
[scroller setHasVerticalScroller:YES];
[scroller setHasHorizontalScroller:YES];
[scroller setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
[[scroller contentView] setAutoresizesSubviews:YES];
//Create the SourceViewer
sr2 = [[SourceViewer alloc] initWithFrame:[scroller frame]];
[scroller setDocumentView:sr2];
//Add the ScrollBars
[scroller setHasVerticalScroller:YES];
[scroller setHasHorizontalScroller:YES];
//Insert Scroller into Tabitem
[item setView:scroller];
//Add TabItem into TabView
[tabView addTabViewItem:item];
[tabView selectLastTabViewItem:self];
[sr2 setSourceType:[type cString]];
[sr2 setSourceCode:initialText];
Thanks
Wezzy
_______________________________________________
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.