[pygtk] GTK_IS_WIDGET on subclass of a widget fails

Jeffrey Barish jeff_barish at earthlink.net
Thu May 21 21:51:12 WST 2009


Jeffrey Finkelstein wrote:

> from gtk import Window, HBox, WINDOW_TOPLEVEL, main
> 
> class FooBox(HBox):
> def __init__(self): pass
> 
> window = Window(WINDOW_TOPLEVEL)
> window.add(FooBox())
> window.show_all()
> main()
> 

You need to init the HBox in the __init__ method:

HBox.__init__(self)

-- 
Jeffrey Barish



More information about the pygtk mailing list