[pygtk] how to call a method of GtkWidget by using object of GtkWindow

Hrvoje Nikšić hrvoje.niksic at avl.com
Mon Aug 20 23:22:45 WST 2007


On Mon, 2007-08-20 at 15:18 +0200, Gian Mario Tagliaretti wrote:
> 2007/8/20, Hrvoje Nikšić <hrvoje.niksic at avl.com>:
> 
> > In PyGTK gtk.Window.show is the same as gtk.Widget.show:
> 
> gtk_window_show doesn't exist.

Which is why gtk.Window.show is the same as gtk.Widget.show.

> > If you want to be sure you're calling gtk.Widget.show and not an
> > overridden method, you can call it explicitly with
> > gtk.Widget.show(window).
> 
> come on...

Calling SuperClass.method(object_of_subclass) is a common Python idiom.
In fact, that's how you call the parent method from the overridden
method.




More information about the pygtk mailing list