bugGNUstep - Bugs: bug #18649, NSScrollview/NSTextView from gorm:...

Group
 
 

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

Submitter:  Paddy Smith <padski>
Submitted:  Sat 30 Dec 2006 09:27:53 PM UTC
   
 
Category:  Gorm Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 25 Feb 2007 07:54:30 AM UTC, comment #1: 

I have observed the same thing. The workaround is

[textView setHorizontallyResizable: NO];

I have no idea why that resets correct behavior.

Mark Tracy <tracy454>
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




Paddy Smith <padski>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #11639:  textview_resize_problem.tgz added by padski (16KiB - application/x-compressed-tar)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tracy454 (Posted a comment)
  • -email is unavailable- added by FredKiefer (Updated the item)
  • -email is unavailable- added by padski (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-02-04 FredKiefer CategoryNone Gorm
    2006-12-30 padski Attached File- Added textview_resize_problem.tgz, #11639

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code