Re: making buttons disable and enable



thanx Mihai for ur ideas
        but i think there has to some other way for accomplishing this job, i.e.
calling GTK+ function calls from other thread.
        if what u say is true then how is it possible that in 'kfind' tool the
'start search' tool button remains disabled as long as the search is going on and as
soon as the search stops it resumes.
        is there any way to hack the 'gtk_main' thread???

Deepak

Mihai BAZON wrote:

> 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
> >
>
> _______________________________________________
> gnome-gui-list mailing list
> gnome-gui-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-gui-list

--
Deepak
dgupta mahindrabt com






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