Re: NSTableView setDoubleAction/NSControl setAction
Re: NSTableView setDoubleAction/NSControl setAction
- Subject: Re: NSTableView setDoubleAction/NSControl setAction
- From: Angela Brett <email@hidden>
- Date: Wed, 7 Aug 2002 22:35:47 +1200
On Wednesday, August 7, 2002, at 11:51 , Angela Brett wrote:
Have a look at David Martin's reply:
If you override -[NSResponder mouseDown:] with something like that:
- (void)mouseDown:(NSEvent *)event {
NSLog(@"mouseDown: %d", [event clickCount]);
}
You'll see a single line with a clickCount of 1 for a single click,
and two lines, first with a clickCount of 1, then a clickCount of 2
for a double click.
In other words, as I said: at the lowest level, an Event comes
*with* knowledge about it being double/single click. That has
nothing to do with being psychic, but with the fact that these
action have been abstracted (we are in an OO-environment after all
and not in Windows 3.1).
I know that, and I'm not at all surprised by David Martin's reply,
it's what I expected. I never said that you should have to translate
clicks into a double click yourself. I was just explaining why you
always get the single click action called before the double click
one... because at the first click, it is not known whether it will be
a double click or not. If you wanted only the doubleclick action to
be called, you'd have to put up with there always being a delay
before the single click action was called because NSEvent would have
to wait and make sure it wasn't going to be a doubleclick before it
called the single click action.
--
Angela Brett
email@hidden
http://acronyms.co.nz/angela
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.