Re: NSCell mouse tracking best practices.
Re: NSCell mouse tracking best practices.
- Subject: Re: NSCell mouse tracking best practices.
- From: Matt Neuburg <email@hidden>
- Date: Tue, 11 Jul 2006 20:00:36 -0700
- Thread-topic: NSCell mouse tracking best practices.
On Mon, 10 Jul 2006 09:56:05 -0700, Corbin Dunn <email@hidden> said:
>Let me get it straight what you are trying to do:
>You want the mouse down to track inside your cell, and when the mouse
>is moved out you do (or do not?) want it to start tracking another
>cell, or still maintain tracking in the original mouse-down cell?
Just to recap: this is an NSImageCell subclass inside an NSMatrix subclass.
Okay, so, I *think* what I want is:
(a) for any given cell, call it cell x, to know when the mouse goes down
inside it
(b) for cell x then to know when the mouse moves after that, wherever it may
go
(c) for cell x then to know when the mouse goes up after that, wherever it
may be
I say "I think" because it may be that one could prove logically that I
don't need to know all that. But that is what it means to me to track the
mouse after it goes down in a cell, so that is my vision of what I'd like to
know.
As I've said, I was able to get (a) and (b) to happen by implementing
trackMouse:..., but I have not been able to get any event to arrive at my
cell when (c) happens, so I had to implement mouseUp: in the matrix instead
(the matrix then contacts all the cells to find out which of them the mouse
went down in originally, and when it finds the right one, it tells it to do
its mouse-up thing).
I thought this solution was rather clever, but if it is the wrong way I'm
happy to hear the right way. Note that I am hoping not to have to implement
a tight loop (i.e. where I short-circuit the event loop and keep looping and
calling nextEventMatchingMask: until the mouse goes up). m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
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