treectrl.expanded Property


value = treectrl.expanded(item, parent);
treectrl.expanded(item, parent) = value;

The property returns true if the item is expanded (its children are visible) and false if it is collapsed. When setting the property the value true will expand the item's children and false will collapse them.

Parameters

item
Required. Either an integer specifying the item handle (in which case the parent is ignored) or a string specifying the item text. The string may contain a regular expression.
parent
Optional. Integer specifying the parent under which to search for the item. Default value is 0, meaning that items specified by text are searched in the whole tree control.

Example

// Test ensureVisible, parent and get/set expanded
    TreeCtrl.ensureVisible("End leaf");
    index = TreeCtrl.parent("End leaf");
    if (!TreeCtrl.expanded(index))
        Env.LogError("Ensure visible did not expand the parent");
    TreeCtrl.expanded(index) = false; // collapse parent back into place
    TreeCtrl.expanded("Node 1") = false; // and the grandparent node
		

See also

treectrl Overview

 


© 2003 Lightweight Technologies. All rights reserved.