pygtk clist usage

Emmanuele Bassi zefram at wolverine.lohacker.invalid
Fri Sep 12 10:30:41 EDT 2003


* Ted Holden [2003-09-12 14:28]:

>> BTW, CList is deprecated (meaning it will go away in the next major gtk
>> release).  ListStore/TreeView can be a bit hard to make the transition to,
>> though, as the documentation is rather scattered and fragmentary.  Best
>> sources of info are...
> 
> I've been trying to take a look at the TreeView/ListStore model.  I mean,
> you've gotta be kidding.  Who do you expect to want to try to figure that
> out in order to use a simple listbox?  

I did, and I do. In C, Python and (yuk) Perl.

The basics of the MVC (model/viewer/controller) paradigm are fully
graspable in less than 15 minutes (at least, that's how much I had to
spend learning them - and I did not know anything about MVC).  The power
of a MVC system, with customisable models and renderers outweights the
underlying complexity.  Alas, the TreeView/TreeModel pair isn't quite as
fast as CTree/CList, so you need some tricks when dealing with large
models, but for simple listboxes, I've never seen any performance
problem whatsoever.

Creating a simple listbox takes no more than 20 lines of code, callbacks
not included.  You could create a class that covers everything you might
want, and reuse it (or submit it to the pygtk mailing list) thoughout a
project or in multiple projects.

> Other than that, I'm seeing a conceptual problem with the pygtk
> documentation is that it appears to all be oriented towards coding gtk
> objects by hand.

I do my coding exactely like this.  I prefer this way, since Glade it's
not flexible enough for me.

> The idea of coding guis by hand is probably unacceptable to most people at
> this point.

Having a(nother) library to depend on when distributing an application,
and an XML file sitting around in order to create the UI, may be
unacceptable to many people.  Your point is?

Bye,
 Emmanuele.

-- 
Emmanuele Bassi            |       [ http://digilander.libero.it/ebassi/ ]
emmanuele.bassi(at)iol.it  |     Linux User #170621, http://counter.li.org
GnuPG Key fingerprint = 4DD0 C90D 4070 F071 5738  08BD 8ECC DB8F A432 0FF4




More information about the Python-list mailing list