[gtkmm] Re: pthreads with gtk/gtkmm



> To be precise, the function that I am trying to put in a thread is:
>
> void *test(void *arg){
>   Args *a = (Args *) arg;
>   Gtk::Main kit(a->argc, a->argv);
>   gdk_rgb_init(); //initialize gtk rgb, used to display images
>   MyCameraFramework myCameraFramework(640, 480, false);
>   kit.run();
>   cout << "run returned" << endl;
>   return NULL;
> }

i would say that you reconsider your application/thread model.

don't know whether the approach to put the gui-mainthread in another thread
works but it is not a good idea.
better create Gtk::Main in main() and then create a separate thread in
MyCameraFramework or also in main(); then use Glib::Dispatcher as a means to
communication with the gui-objects if you use gtkmm-2.x

--
triendl klaus




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