[pygtk] Inheriting from goocanvas.Table
John Stowers
john.stowers.lists at gmail.com
Sun Jun 1 06:51:53 WST 2008
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.
Hi Samuel,
You should probbably ask this question on the goocanvas mailing list
https://lists.sourceforge.net/lists/listinfo/goocanvas-devel
John
>
> -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