• 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: NSBrowser tooltips
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBrowser tooltips


  • Subject: Re: NSBrowser tooltips
  • From: Ken Thomases <email@hidden>
  • Date: Mon, 05 May 2014 17:15:52 -0500

On May 5, 2014, at 4:58 PM, Paul Wasmund wrote:

> I am using an NSBrowser to display items and my code is based on the ComplexBrowser sample from Apple. This uses browser features introduced in 10.6 and does not implement a NSMatrix to display columns. The only support I see for implementing tooltips is browser:shouldShowCellExpansionForRow:column: which does not allow for a custom tooltip, only the display of the entire cell contents if the cell contents doesn't fit in the column. Is there some way of implementing custom tooltips for any cell in the browser?

Well, it's not directly associated with cells, per se, but you can use -[NSView addToolTipRect:owner:userData:] to add a tooltip rect covering the whole browser view (and update it when its bounds change).  Set the owner to an object which implements the NSToolTipOwner informal protocol – i.e. the -view:stringForToolTip:point:userData: method.  In that method, you can translate from the point to a row and column and return an appropriate string.

Cheers,
Ken


_______________________________________________

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


References: 
 >NSBrowser tooltips (From: Paul Wasmund <email@hidden>)

  • Prev by Date: NSBrowser tooltips
  • Next by Date: Re: How to convert a UTF-8 byte offset into an NSString character offset?
  • Previous by thread: NSBrowser tooltips
  • Next by thread: Re: Creating selector for nonexistent method
  • Index(es):
    • Date
    • Thread