phoenix_title wx.dataview.DataViewTreeStore

wx.dataview.DataViewTreeStore is a specialised wx.dataview.DataViewModel for storing simple trees very much like wx.TreeCtrl does and it offers a similar API.

This class actually stores the entire tree and the values (therefore its name) and implements all virtual methods from the base class so it can be used directly without having to derive any class from it, but it is mostly used from within wx.dataview.DataViewTreeCtrl.

Notice that by default this class sorts all items with children before the leaf items. If this behaviour is inappropriate, you need to derive a custom class from this one and override either its HasDefaultCompare method to return False, which would result in items being sorted just in the order in which they were added, or its Compare function to compare the items using some other criterion, e.g. alphabetically.


class_hierarchy Class Hierarchy

Inheritance diagram for class DataViewTreeStore:

method_summary Methods Summary

__init__

Constructor.

AppendContainer

Append a container.

AppendItem

Append an item.

DeleteAllItems

Delete all item in the model.

DeleteChildren

Delete all children of the item, but not the item itself.

DeleteItem

Delete this item.

GetChildCount

Return the number of children of item.

GetItemData

Returns the client data associated with the item.

GetItemExpandedIcon

Returns the icon to display in expanded containers.

GetItemIcon

Returns the icon of the item.

GetItemText

Returns the text of the item.

GetNthChild

Returns the nth child item of item.

InsertContainer

Inserts a container after previous.

InsertItem

Inserts an item after previous.

PrependContainer

Inserts a container before the first child item or parent.

PrependItem

Inserts an item before the first child item or parent.

SetItemData

Sets the client data associated with the item.

SetItemExpandedIcon

Sets the expanded icon for the item.

SetItemIcon

Sets the icon for the item.


api Class API

class wx.dataview.DataViewTreeStore(DataViewModel)

Possible constructors:

DataViewTreeStore()

DataViewTreeStore is a specialised DataViewModel for storing simple trees very much like TreeCtrl does and it offers a similar API.


Methods

__init__(self)

Constructor.

Creates the invisible root node internally.



AppendContainer(self, parent, text, icon=BitmapBundle(), expanded=BitmapBundle(), data=None)

Append a container.

Parameters:
Return type:

wx.dataview.DataViewItem



AppendItem(self, parent, text, icon=BitmapBundle(), data=None)

Append an item.

Parameters:
Return type:

wx.dataview.DataViewItem



DeleteAllItems(self)

Delete all item in the model.



DeleteChildren(self, item)

Delete all children of the item, but not the item itself.

Parameters:

item (wx.dataview.DataViewItem) –



DeleteItem(self, item)

Delete this item.

Parameters:

item (wx.dataview.DataViewItem) –



GetChildCount(self, parent)

Return the number of children of item.

Parameters:

parent (wx.dataview.DataViewItem) –

Return type:

int



GetItemData(self, item)

Returns the client data associated with the item.

Parameters:

item (wx.dataview.DataViewItem) –

Return type:

ClientData



GetItemExpandedIcon(self, item)

Returns the icon to display in expanded containers.

Parameters:

item (wx.dataview.DataViewItem) –

Return type:

Icon



GetItemIcon(self, item)

Returns the icon of the item.

Parameters:

item (wx.dataview.DataViewItem) –

Return type:

Icon



GetItemText(self, item)

Returns the text of the item.

Parameters:

item (wx.dataview.DataViewItem) –

Return type:

string



GetNthChild(self, parent, pos)

Returns the nth child item of item.

Parameters:
Return type:

wx.dataview.DataViewItem



InsertContainer(self, parent, previous, text, icon=BitmapBundle(), expanded=BitmapBundle(), data=None)

Inserts a container after previous.

Parameters:
Return type:

wx.dataview.DataViewItem



InsertItem(self, parent, previous, text, icon=BitmapBundle(), data=None)

Inserts an item after previous.

Parameters:
Return type:

wx.dataview.DataViewItem



PrependContainer(self, parent, text, icon=BitmapBundle(), expanded=BitmapBundle(), data=None)

Inserts a container before the first child item or parent.

Parameters:
Return type:

wx.dataview.DataViewItem



PrependItem(self, parent, text, icon=BitmapBundle(), data=None)

Inserts an item before the first child item or parent.

Parameters:
Return type:

wx.dataview.DataViewItem



SetItemData(self, item, data)

Sets the client data associated with the item.

Parameters:


SetItemExpandedIcon(self, item, icon)

Sets the expanded icon for the item.

Parameters:


SetItemIcon(self, item, icon)

Sets the icon for the item.

Parameters: