Tree View Tutorials?

Started by MattDA, 17 January 2023, 02:13:21

MattDA

Hi. I was trying to create a tree view but I am not sure how it works. It takes an array of strings as an Item but each string of that array creates a deeper indent.
so for example, a string array like {"Object", "SubObject", "SubObject2"}
ends up looking like this.
Object
     SubObject
          SubObject2

But what I want is something like this.
Object
     SubObject
     SubObject2
I see on the main tgui page the screenshots show a proper tree view example. Are those examples available?

texus

There are no examples in the documentation or tutorials yet. A hidden example can be found in the tests: https://github.com/texus/TGUI/blob/0.10/tests/Widgets/TreeView.cpp#L372-L378

So you have to add 2 items: {"Object", "Subobject"} and {"Object", "Subobject2"}