apps-gorm
apps-gorm copied to clipboard
NSScrollview/NSTextView from gorm: text grows but does not shrink
| I have observed the same thing. The workaround is[textView setHorizontallyResizable: NO];I have no idea why that resets correct behavior. | Mark Tracy |
|---|---|
| Sat 30 Dec 2006 04:27:53 PM EST, original submission: Quotewhen I throw together a test app in gorm, the NSTextView does notbehave 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 |
I have observed the same thing. The workaround is
[textView setHorizontallyResizable: NO];
I have no idea why that resets correct behavior.
DeleteFlag as spam
Sat 30 Dec 2006 04:27:53 PM EST, original submission: Quote 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