Re: Glib::Thread && Gtk::Window
- From: "Nickolai Dobrynin" <ndobrynin gmail com>
- To: "Alexander Volosatov" <rope-walker yandex ru>
- Cc: gtkmm-list gnome org
- Subject: Re: Glib::Thread && Gtk::Window
- Date: Wed, 15 Mar 2006 11:54:09 -0600
Alexander,
OK, let's go one step at a time. Are you confident you do
all your GUI work in the same thread (the most common approach) OR are
you confident you synchronize each and every GTK call you make (this
can be both very complex and inefficient)? The following line in
your original post sounds strange to me: "I use Glib::Thread to create
threads for new window". I hope you aren't trying to run every
new window in a different thread. Please clarify.
In general, there is no conceptual difference between the way you would
handle one GTK window and multiple ones. All you do is allocate
each on the heap, keep the pointers around, and access them as needed.
Apologies if I sound too basic, but that seems to be the nature of the problem you are having.
Regards,
Nickolai
On 3/15/06, Alexander Volosatov <rope-walker yandex ru> wrote:
Hello, Nickolai.
You know, I try to replace my window with Gtk::Window(). But there is
the same problem. Main window work OK, but child window is not
responding!!!
Maybe I do something wrong?
> Alexander,
> Are you accidentally calling set_geometry_hints (or some other method that invokes
> set_geometry_hints internally) before the corresponding window has been realized?
> I suggest that you use the cout-statement or GDB to locate the exact line that emits
> these errors. You then insert win.show_all() in front of it. Making sense?
> Best,
> Nickolai
> On 3/14/06, Volosatov Alexander <
rope-walker yandex ru> wrote:
> 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?
> _______________________________________________
> gtkmm-list mailing list
>
gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
--
Ñ óâàæåíèåì,
Alexander mailto:rope-walker yandex ru
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]