[pygtk] Inheriting from goocanvas.Table
Samuel Abels
newsgroups at debain.org
Sat May 31 01:12:08 WST 2008
Hi,
When trying to inherit from goocanvas.Table the do_update method is
never called (see the example code below). Any idea why that does not
work? I looked at the custom widget demos shipped with goocanvas, but
they only write a widget from scratch, not a way to manipulate the
behavior of an existing widget.
-Samuel
----------------------
import gtk
import goocanvas
class CustomTable(goocanvas.Table):
def do_update(self, recursive, cr):
print "do_update() called"
goocanvas.Table.do_update(self, recursive, cr)
window = gtk.Window()
canvas = goocanvas.Canvas()
table = CustomTable()
canvas.get_root_item().add_child(table)
table.add_child(goocanvas.Text(text = "Hello World"))
window.add(canvas)
window.set_size_request(200, 200)
window.show_all()
window.connect('delete-event', gtk.main_quit)
gtk.main()
More information about the pygtk
mailing list