[pygtk] Non-homogenous treeview

Steve McClure smcclure at racemi.com
Tue Mar 16 22:46:45 WST 2004

On Tue, 2004-03-16 at 07:19, David G. Mackay wrote:
> 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

I've use the CTree (0.6.x) when the parent has no real data (at least
none that I wanted in the view) and the columns are really all for the
children but it doesn't sound like a tree view is really going to work
for your application.

> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Steve McClure						Racemi
email: smcclure at racemi.com				75 5th St NE
voice: 404-892-5850					Suite 214
fax: 404-892-7215					Atlanta, GA 30308
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20040316/6360cc89/attachment.bin

More information about the pygtk mailing list