• 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
[SOLVED] Re: NSTableView, binding, and tooltips
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SOLVED] Re: NSTableView, binding, and tooltips


  • Subject: [SOLVED] Re: NSTableView, binding, and tooltips
  • From: Alan Somers <email@hidden>
  • Date: Fri, 7 Jan 2005 23:14:04 -0600

I overrode arrangeObjects: in my NSArrayController subclass with code to queue up a message in the run loop for a designated selector (replaceToolTips) of my NSArrayController subclass. Program flow doesn't return to the run loop until all notifications are done processing, so I'm guaranteed of having a fully configured table view for which to define tool tips. In my designated method, I looped through the arranged objects and defined tool tip rectangles using addToolTipRect:owner:userData: for all the table view rows, linked to the model objects through the userData parameter; the view:stringForToolTip:point:userData: implementation queries the model object for its tool tip string.

I did encounter a minor glitch, though. I could not get the NSRunLoop performSelector:target:argument:order:modes: method to work (selector = @selector(replaceToolTips), target = self, argument = nil, order = 1, modes = [NSArray arrayWithObject:NSDefaultRunLoopMode]). I ended up setting up an NSTimer with a delay of zero seconds.

I have an app with two subclassed NSTableViews where I'm using bindings and subclassed NSArrayControllers. I am attempting to implement context-sensitive tooltips for each row with the text retrieved from the model object that the row represents. I think I have all the pieces figured out except one: How do I determine when the table view is ready for me to set up the tooltips using addToolTipRect:owner:userData:?

It needs to be implemented in such a way that the tooltips can be redefined if the array controller's arranged objects change (including if they're re-sorted) since the tooltip rectangles are dependent on the table rows and not on the objects they represent.

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: Cocoa Bindings - nondebuggable, non-obvious, procedural ???
  • Next by Date: Re: NSTask with non-ASCII paths
  • Previous by thread: Re: Subject: WYSIWIG drawing vs printing (was drawing scaled
  • Next by thread: Reading hex values from a file
  • Index(es):
    • Date
    • Thread