$szTitle = "wxtreeitemdata"; include "./_header.inc"; ?>
wxtreeitemdata is some (arbitrary) user class associated with some item. the main advantage of having this class is that wxtreeitemdata 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 that we don't use wxobject as the base class for wxtreeitemdata because the size of this class is critical: in many applications, each tree leaf will have wxtreeitemdata associated with it and the number of leaves may be quite big.
also please note that because the objects of this class are deleted by the tree using the operator delete, they must always be allocated on the heap using new.
derived from
include files
<wx/treectrl.h>
see also
members
wxtreeitemdata::wxtreeitemdata
wxtreeitemdata::~wxtreeitemdata
wxtreeitemdata::getid
wxtreeitemdata::setid
wxtreeitemdata()
default constructor.
wxpython note: 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 wxtreeitemdata as a container.
in addition, the following methods are added in wxpython for accessing the object:
getdata() | returns a reference to the python object |
setdata(obj) | associates a new python object with the wxtreeitemdata |
wxperl note: in wxperl the constructor accepts as parameter an optional scalar, and stores it as client data. you may retrieve this data by calling getdata(), and set it by calling setdata( data ).
void ~wxtreeitemdata()
virtual destructor.
const wxtreeitemid& getid()
returns the item associated with this node.
void setid(const wxtreeitemid& id)
sets the item associated with this node.
include "./_footer.inc"; ?>