[pygtk] Inheriting from goocanvas.Table

Samuel Abels newsgroups at debain.org
Sat May 31 04:23:00 WST 2008


Nevermind, I just found HippoCanvas, which (except for the missing
documentation) totally rocks and works beautifully.

-Samuel


On Fri, 2008-05-30 at 19:12 +0200, Samuel Abels wrote:
> 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()
> 
> 
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



More information about the pygtk mailing list