[glade--]customizing

Martin Cole <[email protected]>
Newsgroups gmane.comp.gnome.glademm
Message-ID <[email protected]>
Hi,

My project is attempting to just depend on the .glade xml files and use 
libglademm to realize the gui's.

I could not find a way to tell libglade to instantiate my custom widget 
instead of its own (drawing area) widget.

So for a proof of concept I got the widget by name, found its parent, 
removed the widget from the parent, added my instantiated widget in its 
place... like so:

refXml->get_widget("ogl_drawing_area", oda);
Gtk::Container *parent = (Gtk::Container *)oda->get_parent();
if (!parent) {
   std::cerr << "could not get parent!" << std::endl;
   exit(1);
}

parent->remove(*oda);
SimpleGLScene *ogl_widget = new SimpleGLScene();
parent->add(*ogl_widget);

parent->show_all_children(true);

Clearly my inexperience with gtk shows :)

I am guessing there is a much better way to do this, could someone point 
me in the right direction?

thanks,
--mc
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.