Christian Robottom Reis <[EMAIL PROTECTED]> writes: > On Wed, Jul 28, 2004 at 12:06:38PM +0530, Sridhar R wrote: > > we can make use of 'property' to do this .. > > txt = button.text > > button.text = txt
Right. Python 2.2+ descriptors are the general mechanism upon which 'property' is built. One of the big reasons I hacked up the widget descriptor was that I didn't want to have to remember the correct gtk+ property to get or set for the widget value for every kind of widget. For 98% of my GUI code I really don't care if the value I'm getting or setting is a Label, an Entry, a SpinButton, etc. (This is a little lie: for labels it's nice to use pango markup so I sometimes treat them differently than the other simple widget types.) It's annoying to have to remember the widget type everywhere, and if you change a widget from an Entry to a ComboBox then you've got a bunch of fairly pointless changes to make. > > Another important thing is writting proxy widgets doesn't help if UI > > is loaded from glade XML. > > Why not? It shouldn't matter if the widget already exists or not -- just > avoid building one if it already exists. This is the importance of frameworks like kiwi. Let the framework manage the most tedious and/or difficult programming tasks. If you can get Christian to do the hard parts for you you come out ahead. > > so putting it in a line, is this discussion all about making the pygtk > > api much better and easy to use some which includes the one given > > above ? > > Probably not -- it's about raising good design ideas for high-level UI > programming so I can steal them and put them in Kiwi <wink>. Right. I don't think most of this belongs inside of pygtk but rather in frameworks built on pygtk. I hope this doesn't discourage Sridar from contributing his good ideas. I find the discussion helpful, and I think others reading this list do too. For instance, I think we can save new pygtk programmers a lot of frustration and tedium if we can get everyone to use signal autoconnection based on method names as Sridar and others have demonstrated instead of libglade-style dictionary-based autoconnection. Even so, this doesn't belong inside pygtk itself. There are some things we can discuss whether they should be in pygtk. For instance, people have considered in the past whether widget properties should be attributes. That would allow properties to be get and set directly using attribute syntax in addition to using get_property() and set_property(). _______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
