FROM : Joan Lluch (casa)
DATE : Fri Apr 25 21:13:48 2008
Ken, you're Genius !!
Overriding the mouseDown method of a subclassed control containing
the cell and passing to its 'super' an identical NSEvent with
clickCount always 1 did it !
Thank you for your help, I really appreciate it
Joan
El 25/04/2008, a las 09:02, Ken Thomases escribió:
> On Apr 25, 2008, at 1:29 AM, Joan Lluch (casa) wrote:
>> I have implemented a NSButtonCell subclass in the usual way to
>> catch mouse tracking. I get the startTrackingAt and stopTracking
>> messages called correctly on the first click of the mouse. However
>> the startTrackingAt is not quickly called again if I quickly click
>> again the mouse, such as if I did a double click. I mean, if I
>> perform a double or triple click I only get one pair of
>> startTrackingAt and stopTracking calls instead of the desired two
>> or three pairs. So the desired behaviour is to be able to catch
>> all the mouse clicking activity in almost real time. What I get
>> instead is some filtering of the actual mouse clicking. This is
>> the way I implemented the methods
>
> I'm guessing that this "filtering" is being done in -[NSControl
> mouseDown:]. That is, if [theEvent clickCount] is greater than
> one, it doesn't invoke the cell's
> trackMouse:inRect:ofView:untilMouseUp: method.
>
> You can try subclassing the NSControl in question (presumably an
> NSButton?), overriding mouseDown:, and passing a different object
> to [super mouseDown:aDifferentEvent]. You can either create a new
> NSEvent whose properties are all the same as theEvent, or you can
> wrap theEvent in a proxy object which forwards all messages
> faithfully except clickCount, which it intercepts to always return 1.
>
> Good luck,
> Ken
DATE : Fri Apr 25 21:13:48 2008
Ken, you're Genius !!
Overriding the mouseDown method of a subclassed control containing
the cell and passing to its 'super' an identical NSEvent with
clickCount always 1 did it !
Thank you for your help, I really appreciate it
Joan
El 25/04/2008, a las 09:02, Ken Thomases escribió:
> On Apr 25, 2008, at 1:29 AM, Joan Lluch (casa) wrote:
>> I have implemented a NSButtonCell subclass in the usual way to
>> catch mouse tracking. I get the startTrackingAt and stopTracking
>> messages called correctly on the first click of the mouse. However
>> the startTrackingAt is not quickly called again if I quickly click
>> again the mouse, such as if I did a double click. I mean, if I
>> perform a double or triple click I only get one pair of
>> startTrackingAt and stopTracking calls instead of the desired two
>> or three pairs. So the desired behaviour is to be able to catch
>> all the mouse clicking activity in almost real time. What I get
>> instead is some filtering of the actual mouse clicking. This is
>> the way I implemented the methods
>
> I'm guessing that this "filtering" is being done in -[NSControl
> mouseDown:]. That is, if [theEvent clickCount] is greater than
> one, it doesn't invoke the cell's
> trackMouse:inRect:ofView:untilMouseUp: method.
>
> You can try subclassing the NSControl in question (presumably an
> NSButton?), overriding mouseDown:, and passing a different object
> to [super mouseDown:aDifferentEvent]. You can either create a new
> NSEvent whose properties are all the same as theEvent, or you can
> wrap theEvent in a proxy object which forwards all messages
> faithfully except clickCount, which it intercepts to always return 1.
>
> Good luck,
> Ken
| Related mails | Author | Date |
|---|---|---|
| Joan Lluch (casa) | Apr 25, 08:29 | |
| Ken Thomases | Apr 25, 09:02 | |
| Joan Lluch (casa) | Apr 25, 21:13 |






Cocoa mail archive

