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

Hrvoje Nikšić hrvoje.niksic at avl.com
Wed Aug 22 23:21:15 WST 2007


On Wed, 2007-08-22 at 13:12 +0200, Gian Mario Tagliaretti wrote:
> 2007/8/20, Hrvoje Nikšić <hrvoje.niksic at avl.com>:
> > On Mon, 2007-08-20 at 15:18 +0200, Gian Mario Tagliaretti wrote:
> 
> > > gtk_window_show doesn't exist.
> >
> > Which is why gtk.Window.show is the same as gtk.Widget.show.
> 
> It's different, They are equal because of inheritance not because it
> doesn't exist.

If it existed they would be different because gtk.Window.show would be a
separate method that calls gtk_window_show.  I guess I don't understand
what point you're trying to make.

> > 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.
> 
> Again it's not a matter of how python works, that's OOP, we were
> talking about a method that *does not exist* so calling
> gtk.Widget.show it's a wrong concept.

Calling gtk.Widget.show is obviously unnecessary for gtk.Window, but not
for FooWidget that overrides the 'show' method.  I'm not sure that any
of that solves the OP's problem because of the vague description he
gave.




More information about the pygtk mailing list