Glib::Thread && Gtk::Window



Hi everybody!
I need to have more than one window in program, working 
at the same time. In Main window I have table with windows title, 
address for manipulation with windows.
I use Glib::Thread to create threads for new window:

Main_Window::Main_Window()
{
	Glib::thread_init();
	...
}

void Main_Window::on_Open_clicked()
{	
	Glib::Thread *thread = Glib::Thread::create(sigc::mem_fun(*this, &Main_Window::new_thread), true);	
	//thread->join();
}

void Main_Window::new_thread()
{
	cout << "Main_Window::new_thread()...\n";

	DB_ID_TYPE id = 2;

	input_wnd = new InputWindow(id);

	Gtk::TreeModel::Row row = *(refptr_Windows->append());
	row[tablemodel_Windows.column_address] = input_wnd;
	row[tablemodel_Windows.column_id] = refptr_Windows->children().size();
	row[tablemodel_Windows.column_title] = input_wnd->get_title();
	
	Gtk::Main::run(*input_wnd);
}	

When I try to run Window:

(echo.exe:1240): Gdk-CRITICAL **: gdk_window_set_geometry_hints: assertion `wind
ow != NULL' failed
(echo.exe:1240): Gdk-CRITICAL **: gdk_window_resize: assertion `window != NULL'
failed
(echo.exe:1240): Gdk-CRITICAL **: gdk_window_set_geometry_hints: assertion `wind
ow != NULL' failed
(echo.exe:1240): Gdk-CRITICAL **: gdk_window_resize: assertion `window != NULL'
failed

and new window 

And one more quastion:
maybe here is another way to do what I want?



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