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

Re: How to detect clipping of text in NSTextView?


  • Subject: Re: How to detect clipping of text in NSTextView?
  • From: Douglas Davidson <email@hidden>
  • Date: Wed, 27 Jun 2007 09:40:12 -0700


On Jun 27, 2007, at 9:05 AM, Leon Starr wrote:

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...)

Talk to the layout manager. It will tell you, for example, which glyphs are laid out in a particular text container. If that isn't all of them, then not everything is being displayed. If you need notification, you can act as the layout manager's delegate and be notified when layout happens and/or is finished.


Douglas Davidson


_______________________________________________

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:
    • [Solved] Re: How to detect clipping of text in NSTextView?
      • From: Leon Starr <email@hidden>
    • Re: How to detect clipping of text in NSTextView?
      • From: John Stiles <email@hidden>
References: 
 >How to detect clipping of text in NSTextView? (From: Leon Starr <email@hidden>)

  • Prev by Date: Re: Bindings / NSTableView (limitation ?)
  • Next by Date: Re: How to detect clipping of text in NSTextView?
  • Previous by thread: How to detect clipping of text in NSTextView?
  • Next by thread: Re: How to detect clipping of text in NSTextView?
  • Index(es):
    • Date
    • Thread