• 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
Fwd: NSCell mouse tracking best practices.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: NSCell mouse tracking best practices.


  • Subject: Fwd: NSCell mouse tracking best practices.
  • From: Óscar Morales Vivó <email@hidden>
  • Date: Wed, 5 Jul 2006 16:17:18 -0400

I'm trying to implement a custom subclass of NSCell. As part of the work I need to implement mouse event tracking (down, drag & up as usual). The problem is that the methods in NSCell don't pass around the cell's frame and the information is needed to figure out the behavior while dragging. From what I've been reading in the docs, there's two possible solutions:

- Keep around an instance variable for the tracking rectangle. Fill it up in trackMouse:inRect:ofView:untilMouseUp: right before calling super, and then override startTrackingAt:inView:, continueTracking:at:inView and stopTracking:at:inView:mouseIsUp: (NSSliderCell seems to do this).
- Just override the whole trackMouse:inRect:ofView:untilMouseUp: taking care of the event loop there and ignoring the other three mouse tracking methods (That's what the clock control sample code does).


Not having ever done custom NSCell work before, I'd rather ask if there's any 'more sanctioned' way of doing this, as well as any potential pitfalls I might have missed. Pointers to discussions on the topic or more sample code would be welcome too.

Thanks in advance for your help:


Óscar Morales Vivó


_______________________________________________ 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
  • Follow-Ups:
    • Re: NSCell mouse tracking best practices.
      • From: mmalc crawford <email@hidden>
  • Prev by Date: Resizing problems with generated core data entity window
  • Next by Date: Re: NSCell mouse tracking best practices.
  • Previous by thread: Re: Resizing problems with generated core data entity window
  • Next by thread: Re: NSCell mouse tracking best practices.
  • Index(es):
    • Date
    • Thread