Gizmo TreeListCtrl and finding parent item

Hi

A tree is organized with a root and branches / leaves. Each item is appended to an existing thing, either the root or an existing child item.

So each item has a parent from which it is hanging.

I manage to find text of selected item (using DEMO code), but how do I find the text of the parent item?

Thanks for any help.

David

Something like this might give you an idea, its GetItemParent you want for classic style TreeListCtrl

root_item = self.tree.GetRootItem()
parts =
while item != root_item:
# Get the next part
part = self.tree.GetItemText(item, col_tree)
# Prepend this part
parts.insert(0, part)
# Walk up the tree one level
item = self.tree.GetItemParent(item)

``

···

On Monday, March 16, 2015 at 5:32:26 AM UTC-6, David Wende wrote:

Hi

A tree is organized with a root and branches / leaves. Each item is appended to an existing thing, either the root or an existing child item.

So each item has a parent from which it is hanging.

I manage to find text of selected item (using DEMO code), but how do I find the text of the parent item?

Thanks for any help.

David

Thanks Ian
Good idea.

···

On Tuesday, March 17, 2015 at 12:54:14 AM UTC+2, Ian Bell wrote:

Something like this might give you an idea, its GetItemParent you want for classic style TreeListCtrl

root_item = self.tree.GetRootItem()
parts =
while item != root_item:
# Get the next part
part = self.tree.GetItemText(item, col_tree)
# Prepend this part
parts.insert(0, part)
# Walk up the tree one level
item = self.tree.GetItemParent(item)

``

On Monday, March 16, 2015 at 5:32:26 AM UTC-6, David Wende wrote:

Hi

A tree is organized with a root and branches / leaves. Each item is appended to an existing thing, either the root or an existing child item.

So each item has a parent from which it is hanging.

I manage to find text of selected item (using DEMO code), but how do I find the text of the parent item?

Thanks for any help.

David