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.
Constructor. |
|
Append a container. |
|
Append an item. |
|
Delete all item in the model. |
|
Delete all children of the item, but not the item itself. |
|
Delete this item. |
|
Return the number of children of item. |
|
Returns the client data associated with the item. |
|
Returns the icon to display in expanded containers. |
|
Returns the icon of the item. |
|
Returns the text of the item. |
|
Returns the nth child item of item. |
|
Inserts a container after previous. |
|
Inserts an item after previous. |
|
Inserts a container before the first child item or parent. |
|
Inserts an item before the first child item or parent. |
|
Sets the client data associated with the item. |
|
Sets the expanded icon for the item. |
|
Sets the icon for the item. |
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.
__init__
(self)¶Constructor.
Creates the invisible root node internally.
AppendContainer
(self, parent, text, icon=BitmapBundle(), expanded=BitmapBundle(), data=None)¶Append a container.
parent (wx.dataview.DataViewItem) –
text (string) –
icon (wx.BitmapBundle) –
expanded (wx.BitmapBundle) –
data (ClientData) –
AppendItem
(self, parent, text, icon=BitmapBundle(), data=None)¶Append an item.
parent (wx.dataview.DataViewItem) –
text (string) –
icon (wx.BitmapBundle) –
data (ClientData) –
DeleteAllItems
(self)¶Delete all item in the model.
DeleteChildren
(self, item)¶Delete all children of the item, but not the item itself.
item (wx.dataview.DataViewItem) –
DeleteItem
(self, item)¶Delete this item.
item (wx.dataview.DataViewItem) –
GetChildCount
(self, parent)¶Return the number of children of item.
parent (wx.dataview.DataViewItem) –
int
GetItemData
(self, item)¶Returns the client data associated with the item.
item (wx.dataview.DataViewItem) –
ClientData
GetItemExpandedIcon
(self, item)¶Returns the icon to display in expanded containers.
item (wx.dataview.DataViewItem) –
Icon
GetItemIcon
(self, item)¶Returns the icon of the item.
item (wx.dataview.DataViewItem) –
Icon
GetItemText
(self, item)¶Returns the text of the item.
item (wx.dataview.DataViewItem) –
string
GetNthChild
(self, parent, pos)¶Returns the nth child item of item.
parent (wx.dataview.DataViewItem) –
pos (int) –
InsertContainer
(self, parent, previous, text, icon=BitmapBundle(), expanded=BitmapBundle(), data=None)¶Inserts a container after previous.
parent (wx.dataview.DataViewItem) –
previous (wx.dataview.DataViewItem) –
text (string) –
icon (wx.BitmapBundle) –
expanded (wx.BitmapBundle) –
data (ClientData) –
InsertItem
(self, parent, previous, text, icon=BitmapBundle(), data=None)¶Inserts an item after previous.
parent (wx.dataview.DataViewItem) –
previous (wx.dataview.DataViewItem) –
text (string) –
icon (wx.BitmapBundle) –
data (ClientData) –
PrependContainer
(self, parent, text, icon=BitmapBundle(), expanded=BitmapBundle(), data=None)¶Inserts a container before the first child item or parent.
parent (wx.dataview.DataViewItem) –
text (string) –
icon (wx.BitmapBundle) –
expanded (wx.BitmapBundle) –
data (ClientData) –
PrependItem
(self, parent, text, icon=BitmapBundle(), data=None)¶Inserts an item before the first child item or parent.
parent (wx.dataview.DataViewItem) –
text (string) –
icon (wx.BitmapBundle) –
data (ClientData) –
SetItemData
(self, item, data)¶Sets the client data associated with the item.
item (wx.dataview.DataViewItem) –
data (ClientData) –
SetItemExpandedIcon
(self, item, icon)¶Sets the expanded icon for the item.
item (wx.dataview.DataViewItem) –
icon (wx.BitmapBundle) –
SetItemIcon
(self, item, icon)¶Sets the icon for the item.
item (wx.dataview.DataViewItem) –
icon (wx.BitmapBundle) –