Re: fork() and progress bar...



>I figured the only way to do this is to fork() off
>a process and use one to fetch mysql information
>and the other one to update the widget. 

wrong. you can start up a thread do the SQL stuff. this is much more
convenient, since the threads are in the same address space.

but before you do, read the FAQ. the other thread can access GTK+, but
only if it uses locks. otherwise, you need to use some kind of IPC to
notify the main GUI thread that an update of the progress bar is
required. i prefer this latter approach, and i use a pipe to do so.

--p




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