How to wire a GnomeCanvas into glade-based GUI?



In my Python code I define a subclass of GnomeCanvas. 

I want to build most of my gui using glade and instantiate its objects using gtk.glade.XML('myfile.glade')

Can anyone tell me...
(1) what object, if any, I should in my Glade design as a place holder for the GnomeCanvas-subclass I'll be placing there at runtime?
and
(2) at runtime, how I add my GnomeCanvas-subclass instance to the window/widget hierarchy?

In regards to (2) I'm especially confused.  In some test code I wrote, this works:
w = gtk.Window(gtk.WINDOW_TOPLEVEL )
c = gnomecanvas.Canvas(aa=False)
w.add(c)

But in my real code, which involves my GnomeCanvas-subclass and a GUI built from Glade, this *doesn't* work:

# topology_drawing_area is a gtk drawing area, which has a window.  I
# should be able to 'add' a child to any gtk window, right?
topology_drawing_area = wtree.get_widget('topology_drawing_area')
c = NetCanvas_v1(world_model, channel, aa=True)
topology_drawing_area.window.add(c)

Any suggestions?
Thanks,
Christian


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