[pygtk] extending gtk.ListStore

Paul Pogonyshev pogonyshev at gmx.net
Thu Jul 3 03:54:19 WST 2008


Felipe Reyes wrote:
> [...]  The other way that I found (the one that I want to implent) is
> proposed by Davyd Madeley[0], but it doesn't work, I attached a small
> test case.

It fails because you initialize gtk.ListStore as if with one column:

        super(PhotoListStore, self).__init__(Photo)

You probably shoud

        super(PhotoListStore, self).__init__(Photo, str, int)

instead.

> how do you handle the ListStore to avoid data replication?, somebody has
> some tip to do with pygtk the same that davyd does with gobject?

That non-OOP approach of GTK+ tree models always bugged me as
promoting bad coding style: duplicating data between your real back
end and GTK+ GUI tree model with no means of automatic synchronization.
I actually have some old code lying around, maybe I will try to clean
it up and publish somewhere...

In short, I think this is not easy.  Maybe there are ready-made
solutions out there, e.g. in Kiwi, dunno.

Paul


More information about the pygtk mailing list