• 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
NSTextField : Tooltip show Whole String, only when Truncated
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSTextField : Tooltip show Whole String, only when Truncated
      • From: Corbin Dunn <email@hidden>
  • Prev by Date: Re: NSImage initWithPasteboard
  • Next by Date: Proper handling of NSSavePanel and 'Do you want to replace it?' dialog
  • Previous by thread: Re: question about identifying old apps
  • Next by thread: Re: NSTextField : Tooltip show Whole String, only when Truncated
  • Index(es):
    • Date
    • Thread