Re: Gtkmm and thread's question?



lovelinux schrieb:
> void MainFrame::on_timer(){
> Gtk::Window *window;
> window=(Gtk::Window*)(get_toplevel());
> Gtk::MessageDialog dlg(*window,"ok!");
> dlg.set_title("ThreadGUI");
> dlg.run();
> }
> 
> build is success,but running begin thread is error:
> Locking assertion failure Backtrace.............

Do not access GUI stuff from another thread than the "GUI"-thread (which
is normally the main thread)!
Rather send a message from the 2nd thread to the main thread by using
Glib::Dispatcher or the sigx++ library that gives you a whole framework
for such tasks...


Klaus


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