Re: Working thread communicating with main thread (was: Threading Issues with Display)
Re: Working thread communicating with main thread (was: Threading Issues with Display)
- Subject: Re: Working thread communicating with main thread (was: Threading Issues with Display)
- From: Matt Watson <email@hidden>
- Date: Tue, 3 Jul 2001 14:44:39 -0700
Does creating the thread that's doing the UI manipulation with
[NSApplication detachDrawingThread:::] not work?
matt.
On Sunday, July 1, 2001, at 03:23 PM, email@hidden wrote:
I created a Thread that reads the received stream in OmniNetworking and
then updates an NSTextView with the additional String. Unfortunately
the
TextView's display is not always updated when the string is added.
The point is that AppKit is not thread safe, so you have to use
connections to let the two threads communicate. Since it's a
complicated topic, and I had myself a large waste of time having it
working, I have written a web page on this subject:
http://lachand.free.fr/cocoa/Threads.html
Cocoa: How to have two threads communicating asynchroneously
The solution described here does work, but it is probably perfectible.
So don't hesitate to make suggestions, etc. (even for my english...).
Hope this help anyway.
Thomas Lachand-Robert
********************** email@hidden
The Commandant Project: http://lachand.free.fr/
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.
_______________________________________________
MacOSX-dev mailing list
email@hidden
http://www.omnigroup.com/mailman/listinfo/macosx-dev