wx.TreeItemData

Inheritance diagram for wx.TreeItemData:



Description

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

wx.TreeCtrl

Properties Summary

Class API

Methods

__init__(obj=None)

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:

  • obj (PyObject)

Returns:

wx.TreeItemData


Destroy()
No docstrings available for this method.

GetData()

Returns a reference to the Python object.


Returns:

PyObject


GetId()

Returns the item associated with this node.


Returns:

wx.TreeItemId


SetData(obj)

Associates a new Python object with the wx.TreeItemData.

Parameters:

  • obj (PyObject)

SetId(id)

Sets the item associated with this node.

Parameters:


Properties

Data
See GetData and SetData
Id
See GetId and SetId