Re: [Pyobjc-dev] Problems with current SVN and threads
Brought to you by:
ronaldoussoren
From: Francesco P. <fpi...@no...> - 2004-11-18 22:13:11
|
Also if the thread is not actually changing anything in the GUI but merely calling a method in the AppDelegate that, in turn, updates the GUI? f On Nov 18, 2004, at 3:00 PM, bb...@ma... wrote: > On Nov 18, 2004, at 1:45 PM, Francesco Pierfederici wrote: >> Just compile it in XCode and run it. A window will pop up with a text >> field in it. What should happen is that the text in the text field >> changes every 5 seconds. What happens instead is that the app >> freezes. You will see that the way this works is by having a Python >> thread asking the AppDelegate instance to update the text. > > As Joshua indicated, that this ever worked is purely coincidental. > The AppKit does not support threading in that fashion. If you want a > slave thread to diddle the UI, you should use > performSelectorOnMainThread (available somewhere in Foundation or > AppKit). > > This is not unique to PyObjC -- this is a general rule from Cocoa. > > b.bum > > > ------------------------------------------------------- > This SF.Net email is sponsored by: InterSystems CACHE > FREE OODBMS DOWNLOAD - A multidimensional database that combines > robust object and relational technologies, making it a perfect match > for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |