Re: clickCount question
Re: clickCount question
- Subject: Re: clickCount question
- From: matt neuburg <email@hidden>
- Date: Sun, 20 Jul 2003 07:25:54 -0700
On Sat, 19 Jul 2003 23:35:58 -0400, Koen van der Drift
<email@hidden> said:
>
I use a NSTextView delegate (a window controller) to detect a change in
>
the selection of the text. When the selection changes the controller
>
updates another item in the window, that indicates the number of
>
characters in the selection. Now what happens is that when the user
>
doubleclicks in the text, the delegate gets two
>
textViewDidChangeSelection notifications. So the text that displays the
>
number of selected characters changes from the old value to zero to the
>
new value. This doesn't look very nice, so I want to make sure that the
>
item only changes when a double-click occured. How can I change
>
MyTextView so the notification is sent unless a single click took
>
place? Or can textViewDidChangeSelection figure out how many clicks
>
occured?
>
>
I only found clickCount from NSEvent - is there a way to get the event
>
in either solutions?
Yes, there is; you can always ask the window for the current event. (I have
to admit, though, that I often use a more primitive solution: I run a timer
and count clicks for myself. Perhaps I shouldn't be doing that.) m.
--------
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
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.