Re: making buttons disable and enable



Gtk+ is _not_ yet thread-safe, AFAIK (and I think it will not be so very
soon).  This means that you cannot make Gtk+ function calls from another
thread but the main thread.  Some people think this is a limitation, I
personally think it's good; it it were thread-safe, it would be much
slower, less portable, etc.  However, you can avoid problems by using
mutexes to protect Gtk+ calls, or (probably better) -- call Gtk+ from a
single thread.  This can be achieved using some sort of communication
mechanism between threads, and when another thread needs to call a Gtk+
function notify the main thread, which will do the shit..

I hope I'm not wrong (I had the same problems too, but I gave up before
solving them.. :)

Good luck!

--
/*   -*- Mishoo -*-         In the beginning there was nothing,
 *  mishoo websci ro      which exploded.   (The Big Bang Theory)  */

On Mon, 14 May 2001, Deepak Gupta wrote:

> hi to all
>         i'm stuck up with a problem. i'm not able to set the sensitivity of
> buttons on my main widow from a thread running along with the gtk_main(). if i
> try to do so, the gui crashes.
>         any suggestions???
>
> --
> Deepak
> dgupta mahindrabt com
>
>
>
> _______________________________________________
> gnome-gui-list mailing list
> gnome-gui-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-gui-list
>





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