trapping NSTextView keys
trapping NSTextView keys
- Subject: trapping NSTextView keys
- From: Duncan Campbell <email@hidden>
- Date: Fri, 15 Jul 2005 15:49:17 +1000
Hey folks.
I have an NSTextView with a very large amount of text loaded into it.
I wish to perform a function on this text, with each keystroke -
however this function is very expensive and takes a long time to
complete.
What i have done is to setup a timer that fires in the textDidChange:
event - this causes a delay between keystrokes and the beginning of
the function (the timer is reset every time a key is pressed) - which
means the user can keep on typing and once they stop, the function
will be performed.
However, once the function starts I am unable to stop it until it
completes. I have tried setting a boolean in the textDidChange:
event, however it seems this event is not registered until after the
function completes.
Can anyone give me any pointers? Do I need to perhaps run the
function in it's own thread? (and would this cause it to notice a
change in my boolean var)? Am I going about this all wrong?
Many thx.
D.
_______________________________________________
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