• 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 with checkboxes?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBrowser with checkboxes?


  • Subject: Re: NSBrowser with checkboxes?
  • From: Dave Camp <email@hidden>
  • Date: Thu, 13 Dec 2007 12:39:24 -0800

My current attempt at this is a subclass of NSBrowserCell which also creates an NSButton. I've overridden the following methods to dispatch calls to either the NSButton or super depending on the coordinates:

- drawWithFrame:nView:
- startTrackingAt:inView:
- continueTracking:at:inView:
- stopTracking:at:inView:mouseIsUp:
- trackMouse:inRect:ofView:untilMouseUp:

That gets me part of the desired functionality. The checkbox and the browser cell display and track the mouse as expected, and clicking the checkbox toggles it on and off.

What I can't get to work is the action message from the checkbox. I've set the target and action for the embedded checkbox to send a message to my window controller. I need this so that the window controller can tell which checkbox was clicked and do something to the item that cell represents. What happens is that my window controller gets called, but the sender is the enclosing NSMatrix, not the cell itself.

Looking at the docs for NSMatrix, I can see there are rules for how to dispatch action messages when both the target and action of a cell are not set, but I've verified in the debugger that the action and target are in fact set in my embedded checkbox.

Thoughts?

Dave
_______________________________________________

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: NSBrowser with checkboxes?
      • From: Benjamin Stiglitz <email@hidden>
References: 
 >NSBrowser with checkboxes? (From: Dave Camp <email@hidden>)

  • Prev by Date: [NSImage initWithData]: Memory leak. Bug in code or in Framework?
  • Next by Date: Re: Notification of the end of implicit animations
  • Previous by thread: Re: NSBrowser with checkboxes?
  • Next by thread: Re: NSBrowser with checkboxes?
  • Index(es):
    • Date
    • Thread