A Multilevel Liststore

View: New views
2 Messages — Rating Filter:   Alert me  

A Multilevel Liststore

by Shadi Azoum-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am trying to make a hierarchal structure using the PyGTK ListStore.  
What would the code look like for a multilevel structure such as the  
one below:

Parent 1
    Child 1.1
    Child 1.2
    Parent 1.3
       Child 1.3.1
       Child 1.3.2
    Child 1.4
Parent 2
    Child 1
    Child 2
...

I know the code if it was just one parent with multiple children, but  
not when those children are the parents of others.

Any help would be greatly appreciated.

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

Re: A Multilevel Liststore

by jeffbarish :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Shadi Azoum wrote:

> Hi,
>
> I am trying to make a hierarchal structure using the PyGTK ListStore.
> What would the code look like for a multilevel structure such as the
> one below:
>
> Parent 1
>     Child 1.1
>     Child 1.2
>     Parent 1.3
>        Child 1.3.1
>        Child 1.3.2
>     Child 1.4
> Parent 2
>     Child 1
>     Child 2
> ...
>
> I know the code if it was just one parent with multiple children, but
> not when those children are the parents of others.

Use a TreeStore instead of a ListStore.
--
Jeffrey Barish

_______________________________________________
pygtk mailing list   pygtk@...
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
LightInTheBox - Buy quality products at wholesale price