Tree View with Tree Model where sub items have their own columns / different structure

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

Tree View with Tree Model where sub items have their own columns / different structure

Klaus Rudolph
Hi all,

I found the example for tree views here: https://developer.gnome.org/gtkmm-tutorial/stable/sec-treeview-examples.html.en
In section "9.8.2. TreeStore" I see, that sub items contain the same elements as the parent items.

The example given in the linked web side provides something like this:

X1,Y1,Z1
  X11,Y11,Z11
  X12,Y12,Z12
X2,Y2,Z2

and so on...


What I search for is a tree view which has instead the following structure:

X1
  Y11
  Y12
X2
  Y21
  Y22
     Z221

and so on.


How can I build up a tree view / model which gives me a representation and view as given in above example?

Regards
 Klaus
_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|

Re: Tree View with Tree Model where sub items have their own columns / different structure

Daniel Boles
What are X, Y, and Z meant to be? Do you mean that you want child items to have different column types from their parents?


_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|

Re: Tree View with Tree Model where sub items have their own columns / different structure

Klaus Rudolph

Hi,
 
 

> What are X, Y, and Z meant to be? Do you mean that you want child items to have different column types from their parents?
 

The first column should only be used by first level of elements. The next column by the next level of items until the last column should only be used by the leaves of the tree. I was in hope that my textual graphic will already a pricture of the structure. Sorry that id did not. I have no idea how to describe in much more detail, because it is as simply as already mentioned :-(

Maybe as another use case, like a file chooser. So a path structure should be presented as:

/dir1/subdir1/file1
/dir1/subdir1/file2
/dir1/subdir2/file3
/dir2/subdir3/file4

Should become:

dir1
     subdir1
             file1
             file2
     subdir2
             file3

dir2
     subdir3
             file4

Can you catch me?

Regards
 Klaus
_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|

Re: Tree View with Tree Model where sub items have their own columns / different structure

Daniel Boles
Sure, but that to me is not an issue of the columns (data types of each row), but rather just how you convert a path to its position within the tree, and how nodes are indented relative to each other. The columns will all have the same type, in this case text (and maybe an icon, etc.).

Put another way: you don't want to have to maintain an arbitrary number of columns, where the definition of the model changes depending on how deeply nested your directory structure is, and where each row only uses one of those many columns.


_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|

Aw: Re: Tree View with Tree Model where sub items have their own columns / different structure

Klaus Rudolph
Hi,


> Sure, but that to me is not an issue of the columns (data types of each row), but rather just how you convert a path to its position within the tree,

No, my problem is how to leave the unused columns in each row blank. E.g. if I have an int type as column an unset value will be displayed as "0" which is not what I want to achieve. i simply have no idea how to hide/remove/leave empty a unused column in a sub entry.  



> and how nodes are
> indented relative to each other.

Yes, but how can I modify the beahviour of the TreeView Widget? I did not find any configuration for that topic. Can you point me to it?

> The columns will all have the same type, in this case text (and maybe an icon, etc.).

Right

> Put another way: you don't want to have to maintain an arbitrary number of columns, where the definition of the model changes depending on how deeply nested your directory
> structure is, and where each row only uses one of those many columns.
 
And what did that mean? Which conatainer widget can I use for this topic? Have I write a own one?

Sorry, I still have no idea how to create a simple TreeView which did not contain all columns for each row.

Regards
 Klaus
_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list