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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to