Rapid use of NSTextField
Rapid use of NSTextField
- Subject: Rapid use of NSTextField
- From: Justin Bakse <email@hidden>
- Date: Sun, 18 Apr 2004 14:49:30 -0500
Hello,
I am working on a project that changes the content of and focus of user
editable NSTextFields programaticly. I've noticed that if i rapidly
(say 2 dozen times a second) cycle the focus of the the fields
sometimes my program stops responding (freezes).
I get this message:
Unlocking Focus on wrong view (<NSView: 0x3338c0>), expected
<MyTextField: 0x335d10>
Also, just using [MyNSTextField setIntValue:targetValue]; quickly can
cause my program to freeze. I've tested this with just calling
setIntValue 4 times in a row in a single call to a function, and this
causes a freeze.
An important (i think) factor is that i am doing these changes from a
seperate thread, actually they are called as a result of a midi input
port proc.
I have reduced the problem by moving the changes to a seperate thread
that only updates fields every 1/4 second, based on a variable set in
the other thread, but that is sort of messy.
Are there any special precautions i should be using working with
NSTextfields (or controls in general) in a threaded app? Any thing else
come to mind?
Thankyou -justin
_______________________________________________
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.