[glade--]customizing
- From: Martin Cole <mjc sci utah edu>
- To: glademm-list gnome org
- Subject: [glade--]customizing
- Date: Wed, 14 May 2003 11:02:31 -0600
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]