Re: Refreshing the GUI without gtk_main ()



On Sat, Apr 17, 2004 at 11:23:46AM +0100, Chris Seaton wrote:
Russell Shaw wrote:
Previous posts have said not to do *any* gui operations outside of the
main gtk thread. Is there a list of what can and can't be done?

I think you can do anything, provided you use the gdk_threads_... wrapper.

Theoretically, yes. In practice, this will not work on Win32. Any
function that leads to a PostMessage (which includes a lot of
fundamental and weird stuff in Win32) will deadlock.

http://www.mail-archive.com/pygtk daa com au/msg07564.html


Any way that you do it, your GUI must never become unresponsive as the
result of a normal operation such as reading from a file. That's
completely unacceptable, and how applications like Windows Explorer
manage to be written.

All of the platforms that GTK runs on have some facility for non
blocking or async I/O. 

Anyway, I personally will accept a correct "unresponsive" application
over a race filled multithreaded application because the developer did
not have the time to do it right. To me, the latter is completely
unacceptable, but I guess values differ.


Take the Nautilus developer's approach - simply banish the idea of any
IO in the main thread.

Which may be fine for applications like Nautilus. Assuming what's
good for Nautilus is good for every GTK application is not prudent.
Have you seen the Nautilus source, it isn't exactly trivial. A small
project might be better off producing an occasionally "unresponsive"
application that is correct rather than a race ridden threaded mess that
crashes with certain usage patterns. KISS applies here.

-jkl



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]