How to detect clipping of text in NSTextView?
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