NSTextView Resize Behavior
NSTextView Resize Behavior
- Subject: NSTextView Resize Behavior
- From: Dong Feng <email@hidden>
- Date: Sat, 09 Jun 2012 21:50:00 +0800
Hi all,
I tried to understand how NSTextView works with NSScrollView,
especially when wrapping disabled. My understanding is that NSTextView
automatically grow its height (by default) and its width (need some
tweak) according to users adding new line and adding new characters.
So I did an experiment, creating a NSTextView without a containing
NSScrollView, with the following settings (for a textview within a
scrollview, the following code works well),
[[_aView textContainer] setContainerSize:NSMakeSize(FLT_MAX, FLT_MAX)];
[[_aView textContainer] setWidthTracksTextView:NO];
[_aView setHorizontallyResizable:YES];
[_aView setVerticallyResizable:YES];
No surprisingly, the textview auto-grows its height when I kept
inserting new lines. But it refuses to grow the width. What did I
miss?
Thanks,
Dong
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden