wxRuby Documentation Home

Wx::TreeItemData

TreeItemData is some (arbitrary) user class associated with some item. The
main advantage of having this class is that 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 that we don’t use Object
as the base class for TreeItemData because the size of this class is
critical: in many applications, each tree leaf will have TreeItemData
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

ClientData

See also

TreeCtrl

Methods

TreeItemData.new

destructor()

Virtual destructor.

TreeItemData#get_id

TreeItemId get_id()

Returns the item associated with this node.

TreeItemData#set_id

set_id(%(arg-type)TreeItemId% id)

Sets the item associated with this node.

[This page automatically generated from the Textile source at 2023-06-13 21:31:31 +0000]