Re: Gtk::Window as a child widget



Hi!

First, you cannot add a Gtk::Window to a Gtk::Container but you can
still use glade by taking the first child of the Window, e.g a Gtk::Box
or a Gtk::Table and add this to the container.

Maybe the easiest way for you would be to create a Gtk::Notebook, hide
the tab labels and call "set_current_page" if the user selects a
different item in the tree. I think that it the way anjuta is doing it
(it's in libanjuta/preference_dialog.c if you are curious).

Regards,
Johannes

Marek Habersack schrieb:
> Hello,
> 
>   I'm very new to gtkmm programming and not very advanced with GTK+
> programming in general, so forgive me if the question I am going to ask
> is stupid/known/etc.
>   I'm working on an application (using gtkmm and glademm) which has
> in its main window a horizontal panel with the left part being a
> Gtk::TreeView and the right part a Gtk::ScrolledWindow. The application
> should respond to user selecting leaves in the tree by showing a
> different page of widgets in the right-hand scrolled window. So it
> should work similar to a notebook, with the navigation part being the
> tree. In the application glade file I created windows (popup type)
> which are supposed to be loaded from the tree selection changed signal.
> Everything works fine until I try to add the Gtk::Window loaded from
> glade to the scrolled window at which point the application aborts with:
> 
> Gtk-ERROR **: file gtkcontainer.c: line 2447
> (gtk_container_propagate_expose): assertion failed: (child->parent ==
> GTK_WIDGET (container)) aborting... Aborted
> 
> I've seen anjuta do something similar for its preferences window, so
> it's clear that I'm doing something incorrectly. I tried reparenting
> the loaded "page" window, but then I'm getting the following error:
> 
> (agent:26975): Gtk-CRITICAL **: gtk_widget_reparent: assertion
> `widget->parent != NULL' failed
> 
> (agent:26975): Gtk-WARNING **: Can't set a parent on a toplevel widget
> 
> Is what I'm describing doable at all? Thanks in advance for any help,
> 
> best regards,
> 
> marek
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list

Attachment: signature.asc
Description: OpenPGP digital signature



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