Re: clickCount question
Re: clickCount question
- Subject: Re: clickCount question
- From: Julien Jalon <email@hidden>
- Date: Mon, 21 Jul 2003 11:46:59 +0200
On Monday, Jul 21, 2003, at 03:39 Europe/Paris, Koen van der Drift
wrote:
Thanks again,
A problem is that the value of com.apple.mouse.doubleClickThreshold
might not be present, which will default cachedDblClickThreshold to
0.1, which results in a zero that is briefly visible. This actually
happened on my machine. I had to go into the mouse preferences and
click the click speed slider to set it's value in the global prefs.
The reason that my global prefs didn;t have a doubleClickThreshold
could be that I am using a Kensington mouse which adds it own prefs
panel.
Yes, I took 0.1 but I don't know the default for this (value if you
never changed that threshold).
So I was thinking, one thing I learned from programming in Cocoa/ObjC
(and other frameworks) is that if you are struggling with the code,
probably the approach is wrong. Maybe I shouldn't test for
doubleClickThreshold within textViewDidChangeSelection? Is there a
possible other way to hook into the click event that will make it
easier to do this - maybe in the NSTextView itself?
This approach is right (but there might be a better solution to get
double click threshold). The only problem that you have is that you
want to discard the one-click event if there is a double-click event
(not exactly... you want to discard the selection change notification
for one-click event if there is a double-click). Since the framework
can't tell at first-click time that there will be a second (or a
third...) click, you have to use that sort of code.
--
Julien Jalon
http://www.julien-jalon.org/
_______________________________________________
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.