NSTextField : Tooltip show Whole String, only when Truncated
NSTextField : Tooltip show Whole String, only when Truncated
- Subject: NSTextField : Tooltip show Whole String, only when Truncated
- From: Jerry Krinock <email@hidden>
- Date: Fri, 16 Sep 2011 10:47:24 -0700
I'd like an NSTextField to display a tooltip showing its entire text whenever it's truncating. I think that NSTableView has this behavior built in, if you simply don't set a tooltip on a cell. But NSTextField does not.
It *sure would be nice* if NSTextField had an observable 'isTruncating" property which I could bind to!
Am I not seeing some feature which will give the desired behavior?
If not, the only solution I can think of is to do the whole damned text measurement thing, taking as parameters the font, the typesetter behavior for the given Mac OS X version, and see if the calculated width exceeds the field width. This kind of thing usually requires, in addition, a fudge factor and/or term, adjusted experimentally to match the actual truncation threshold. Ugh.
Rather than the above, I think I'll just leave the tooltip "always on" and hope that users don't get too annoyed. Any better ideas?
Thanks,
Jerry Krinock
_______________________________________________
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