• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTextView Resize Behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Text System Document Obsolete and Replacement
  • Next by Date: NSFileWrapper/NSDocument package saving performance trouble
  • Previous by thread: Text System Document Obsolete and Replacement
  • Next by thread: NSFileWrapper/NSDocument package saving performance trouble
  • Index(es):
    • Date
    • Thread