Inheritance diagram for wx.TreeItemData:
wx.TreeItemData is some (arbitrary) user class associated with some item. The main advantage of having this class is that wx.TreeItemData objects are destroyed automatically by the tree and, as this class has virtual destructor, it means that the memory and any other resources associated with a tree item will be automatically freed when it is deleted.
Note
Note that we don’t use wx.Object as the base class for wx.TreeItemData because the size of this class is critical: in many applications, each tree leaf will have wx.TreeItemData associated with it and the number of leaves may be quite big.
See also
Default constructor. The wxPython version of this constructor optionally accepts any Python object as a parameter. This object is then associated with the tree item using the wx.TreeItemData as a container.
In addition, the following methods are added in wxPython for accessing the object:
Method | Description |
---|---|
GetData () | Returns a reference to the Python Object |
SetData (obj) | Associates a new Python Object with the wx.TreeItemData |
Parameters:
Returns:
Returns a reference to the Python object.
Returns:
PyObject
Returns the item associated with this node.
Returns:
Associates a new Python object with the wx.TreeItemData.
Parameters:
Sets the item associated with this node.
Parameters: