P
Praful
Hi
I'm writing a GUI that starts a worker thread using Thread.start. The
Cocoa docs say that you should update the GUI using the main thread
only. However, the examples that ship with Leopard, eg SimpleApp, have
a thread that update the GUI from the thread without passing it to the
main thread.
I would like to update a textview (with log info) and a progress bar
from the worker thread. At the moment the worker thread is updating
the log quite happily -- it's passed a closure from the controller and
calls log.call(msg).
Given that the examples and Cocoa docs seem to contradict each other,
what is the correct of doing this? I'd very much appreciate sample
code since I've just started using RubyCocoa (which is great!).
Thanks
Praful
I'm writing a GUI that starts a worker thread using Thread.start. The
Cocoa docs say that you should update the GUI using the main thread
only. However, the examples that ship with Leopard, eg SimpleApp, have
a thread that update the GUI from the thread without passing it to the
main thread.
I would like to update a textview (with log info) and a progress bar
from the worker thread. At the moment the worker thread is updating
the log quite happily -- it's passed a closure from the controller and
calls log.call(msg).
Given that the examples and Cocoa docs seem to contradict each other,
what is the correct of doing this? I'd very much appreciate sample
code since I've just started using RubyCocoa (which is great!).
Thanks
Praful