Re: [gtkmm] Need advise



----- Original Message ----- 
From: "Matthew Walton" <matthew alledora co uk>
To: "Benoît Touron" <B Touron citb bull net>
Cc: <gtkmm-list gnome org>
Sent: Thursday, March 11, 2004 9:49 AM
Subject: Re: [gtkmm] Need advise


> Benoît Touron wrote:
> > 2) Is gtkmm/gtk+ thread safe ? I mean, can I call methods of an object
> > created in thread A, from thread B ?
>
> No. You will cause much pain if you try and update gtkmm objects from
> multiple threads. You'll have to have one thread which handles all GUI
> actions. Glib::Dispatcher provides an interface suitable for allowing
> the various threads to signal to each other so that worker threads may
> request GUI updates.

Is it really true that you _have_ to have one thread touching the
gtkmm-functions? At least with gtk+ you can update the gui from multiple
threads if you use gdk_threads_enter()/leave(), I have done so successfully
in a few projects. However, it might be easier to do all gui-related work in
the main thread, but I really wonder if it really is a requirement?

//Hugo




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