*************** wx.TreeItemData *************** Inheritance diagram for `wx.TreeItemData`: | .. inheritance-diagram:: 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. .. seealso:: `wx.TreeCtrl `_ Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `Destroy <#Destroy>`_ * `GetData <#GetData>`_ * `GetId <#GetId>`_ * `SetData <#SetData>`_ * `SetId <#SetId>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Data <#Data>`_ * `Id <#Id>`_ Class API ========= Methods ^^^^^^^ .. method:: __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 <#GetData>`_ () Returns a reference to the Python Object `SetData <#SetData>`_ (obj) Associates a new Python Object with the `wx.TreeItemData` ============================= =========================================== | **Parameters:** * `obj` (PyObject) | **Returns:** `wx.TreeItemData `_ -------- .. method:: Destroy() `No docstrings available for this method.` -------- .. method:: GetData() Returns a reference to the Python object. | **Returns:** `PyObject` -------- .. method:: GetId() Returns the item associated with this node. | **Returns:** `wx.TreeItemId `_ -------- .. method:: SetData(obj) Associates a new Python object with the `wx.TreeItemData`. **Parameters:** * `obj` (PyObject) -------- .. method:: SetId(id) Sets the item associated with this node. **Parameters:** * `id` (`wx.TreeItemId `_) -------- Properties ^^^^^^^^^^ .. attribute:: Data See `GetData <#GetData>`_ and `SetData <#SetData>`_ .. attribute:: Id See `GetId <#GetId>`_ and `SetId <#SetId>`_