• 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
How to detect clipping of text in NSTextView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to detect clipping of text in NSTextView?


  • Subject: How to detect clipping of text in NSTextView?
  • From: Leon Starr <email@hidden>
  • Date: Wed, 27 Jun 2007 09:05:02 -0700

I have an NSTextView with a fixed width that resizes vertically
up to a maximum depth (two lines).

The user may enter a string a bit longer than what I am allowing the
text view to display.  (I don't want to resize the view to accommodate
the text).

I would like to display a visual cue so that the user knows text has
been clipped.  Like a + sign or something.

Is there some notification that will tell me when the text view's container
begins to clip text?


I know that I can use -sizeWithAttributes to get a single-line bounding box
size, but that doesn't take into account line wrapping. Otherwise I could just
compare bounding box sizes on each text change. (Worst case, I suppose
I could just work out the line wrap computation myself...)


Any pointers or suggestions greatly appreciated!


_______________________________________________

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


  • Follow-Ups:
    • Re: How to detect clipping of text in NSTextView?
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: Two NSRects adjacent/touching?
  • Next by Date: CFBundleShortVersionString
  • Previous by thread: Re: Correct approach?
  • Next by thread: Re: How to detect clipping of text in NSTextView?
  • Index(es):
    • Date
    • Thread