[pygtk] Non-homogenous treeview
David G. Mackay
mackay_d at bellsouth.net
Tue Mar 16 20:19:19 WST 2004
On Tue, 2004-03-16 at 01:31, David M. Cook wrote:
> On Mon, Mar 15, 2004 at 10:26:37PM -0600, David G. Mackay wrote:
>
> > Is there any way to implement a treeview (other than deriving a new
> > class from scratch) with allows child nodes to be differently formatted
> > from the parent nodes? I would like to use a treeview to view
> > information from a database with related tables.
>
> TreeModels are row oriented, i.e. each node is a row of with a fixed number
> of columns with fixed types. However, in the TreeView you can control the
> visibility, editibility, background color, font, and any other properties
> supported by the renderer(s) for each column on a row by row and cell by
> cell basis. You can do this by specifying that the renderer properties
> should be taken from particular columns of the model
>
> (example of setting the editable property this way)
>
> http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq13.010.htp
>
> or you can specify callback functions to set the properties:
>
> http://www.async.com.br/faq/pygtk/index.py?req=all#13.29
That's all very good, but if I want to view a parent with 20 columns,
and then a child with 10 distinct columns, then it's going to get pretty
unwieldy. Then, let's consider that the child might have children. The
issue isn't whether I can store, retrieve, and edit the information in
the treeview, it's whether I can display it in a comprehensible form.
BTW, I've read the FAQ, I was just hoping that there was something else
that I hadn't seen.
Dave
More information about the pygtk
mailing list