gtk.TreeStore with variable column count ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

gtk.TreeStore with variable column count ?

Adrian Immler
how can i create a gtk.TreeStore with a variable count of the columns ?

or

how can i add/remove columns from a TreeStore ?

i need to draw a table like in gnumeric where i don't know how many
columns i need so i will have to contruct it dynamically, any ideas ?

thanks in advance,

adrian
_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Reply | Threaded
Open this post in threaded view
|

Re: gtk.TreeStore with variable column count ?

David M. Cook
On Wed, Jun 01, 2005 at 08:54:52AM +0000, Adrian Immler wrote:

> how can i create a gtk.TreeStore with a variable count of the columns ?
> how can i add/remove columns from a TreeStore ?

I don't think it's possible to add/remove columns from an existing store.  

Instead I would suggest using objects (which could just be dictionaries) in
your TreeStore together with a TreeView data func.  This gives you lots of
flexibility.  Alternatively, you could get a TreeModelFilter from your
model. See the tutorial for more info.

Dave Cook



_______________________________________________
pygtk mailing list   [hidden email]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/