Skip to content

NSScrollview/NSTextView from gorm: text grows but does not shrink #74

@gcasa

Description

@gcasa
I have observed the same thing. The workaround is[textView setHorizontallyResizable: NO];I have no idea why that resets correct behavior. Mark Tracy Flag as spam
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.

Mark Tracy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions