A Qui, 2003-08-07 às 19:22, Iñaki García Etxebarria escreveu: > Howdy everyone, > > Attached goes a patch against pygtk 1.99.17 that lets you do things like > --- > label = gtk.Label() > label.label = 'Hello World' # Changes the label in the gui > print label.label # prints 'Hello World'
Perhaps it is wiser to add a small prefix to the python attribute, to avoid possible conflicts with user code? Example: label = gtk.Label() label.prop_label = 'Hello World' # Changes the label in the gui print label.prop_label # prints 'Hello World' Or maybe not... Either way is fine by me, I think this is a great idea. > --- > for any gobject. I.e., setting gobject properties as if they were > regular attributes. I hope this hasn't been decided against before, imho > it is nice sugar. > > I'm a novice with Python and not an expert with gtk2, so I don't expect > it to be accepted (the method is certainly not optimal and probably not > Pythonesque in style), but hopefully it will inspire someone to > implement the feature properly. > > Kind regards, > Iñaki > > ______________________________________________________________________ > _______________________________________________ > pygtk mailing list [EMAIL PROTECTED] > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ -- Gustavo João Alves Marques Carneiro <[EMAIL PROTECTED]> <[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/