Multi-threaded GUI

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

 



I am a new programmer to GTK and I am trying to wrap my head around several things. The biggest being the fact that GTK main is single threaded and blocking. I am using the gtkmm package.

Basicaly what happens is that when a user presses a connect button on my interface, the callback fires up a seperate pthread to handle the connection. Unfortunately I want this new thread to update the interface regularly to let the user know it is trying to connect.

I have tried using the following code:

while(Gtk::Main::events_pending() )
{
       Gtk::Main::iteration();
}


Now GTK keeps complaining that it is being told to update from outside the Gtk::Main loop, and the program is EXTREMELY flaky, usualy dying on a signal 11 shortely.

How do I get the main loop to update the interface without killing everything? I have tried finding information on the Glib::Dispatcher system but there is really no information on how it works, or how to use it.

Any help would be greatly apreciated.

Sincerely
Melvin Newman
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux