On Thu, Sep 25, 2003 at 04:28:45PM +1200, Tim Evans wrote:
> There is nothing wrong with subclass a gtk widget class in Python.
> Something like this should work fine:
>
> class MyTopWidget(gtk.VBox):
> def __init__(self):
> gtk.VBox.__init__(self, False, 6)
> self.set_border_width(12)
> self.connect('expose-event', self._on_expose)
>
> def add(self, widget):
> self.pack_start(widget, fill=True, expand=True)
>
> def _on_expose(self, widget, event):
> print "I've been exposed!"
>
> Make sure that you are using pygtk-2.0.0. I don't think that
> subclassing will work at all with 0.6, and some 1.99.x versions had
Note that subclassing *does* work fine in 0.6 -- Kiwi uses it all over
the place :-)
Take care,
--
Christian Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/