Sat 30 Dec 2006 09:27:53 PM UTC, original submission:
when I throw together a test app in gorm, the NSTextView does not
behave as I would expect, although it works okay from code like this:
NSScrollView *textScrollView = [[NSScrollView alloc] initWithFrame: mRect];
[textScrollView setBorderType: NSBezelBorder];
[textScrollView setHasHorizontalScroller: NO];
[textScrollView setHasVerticalScroller: YES];
[textScrollView setAutoresizingMask: NSViewHeightSizable|NSViewWidthSizable];
mRect = [[textScrollView contentView] frame];
NSTextView *textView = [[NSTextView alloc] init];
[textView setFrame: mRect];
[textView setTextContainerInset: NSMakeSize(5,5)];
[textView setBackgroundColor: [NSColor textBackgroundColor]];
[textView setRichText: YES];
[textView setUsesFontPanel: YES];
[textView setHorizontallyResizable: NO];
[textView setVerticallyResizable: YES];
[textView setMinSize: NSMakeSize (0, 0)];
[textView setMaxSize: NSMakeSize (1E7, 1E7)];
[textView setAutoresizingMask: NSViewHeightSizable|NSViewWidthSizable];
[[textView textContainer] setContainerSize: NSMakeSize (mRect.size.width, 1E7)];
[[textView textContainer] setWidthTracksTextView: YES];
[textView setString: @""];
[textScrollView setDocumentView: textView];
[[myWindow contentView] addSubview: textScrollView];
(code from GNUmail)
instead it grows when resized horizontally but will not shrink back.
see attached tgz for demo of problem + screenshot
|