(sorry that I missed this mail, thanks to christian for reminding me,
try to put me on the cc list in the future)

tis 2004-06-08 klockan 09.33 skrev David M. Cook:
> On Fri, Jun 04, 2004 at 01:35:37PM +0200, Johan Dahlin wrote:
> 
> > That demonstrates how to subclass a GtkWidget in PyGTK.
> 
> What about when constructors require arguments?  Is this still an issue?

Depend on how you look at it. I think that most (all?) widgets/objects
in Gtk+ have all their arguments as properties, so if you'd like to
emulate gtk_button_new_label, you'd have to do something like this:

class MyButton(gtk.Button):
  def __init__(self, label):
    self.__gobject_init__()
    self.set_property('label', label)

Which is kinda ugly, but unfortunately the way it is right now.

-- 
Johan Dahlin <[EMAIL PROTECTED]>

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to