============== Tree (hwx.gui) ============== Hierarchical list of items. Inherits: - :ref:`Widget (hwx.gui)` ---------- Properties ---------- +----------------+ | selectionMode_ | +----------------+ -------------- Public Methods -------------- +-------------------------------------------------------+ | add_ (self, parent=None, text=None, **kwds) | +-------------------------------------------------------+ | clear_ (self) | +-------------------------------------------------------+ | collapseAll_ (self) | +-------------------------------------------------------+ | ensureItemVisible_ (self, item) | +-------------------------------------------------------+ | expandAll_ (self, expanded=True) | +-------------------------------------------------------+ | get_ (self) | +-------------------------------------------------------+ | getChildren_ (self, parent=None) | +-------------------------------------------------------+ | getSelected_ (self) | +-------------------------------------------------------+ | remove_ (self, item) | +-------------------------------------------------------+ | setSelected_ (self, items, selected=True, clear=True) | +-------------------------------------------------------+ ---------------- Property Details ---------------- .. _selectionMode: .. method:: selectionMode The selection mode. Valid choices are: - "single" - "extended" - "multi" - "contiguous" - "none" -------------- Method Details -------------- .. _add: .. method:: add(self, parent=None, text=None, **kwds) Adds a TreeItem to the Tree. :param parent: A TreeItem to define hierarchy. :type parent: TreeItem, optional :param text: The text that gets displayed. :type text: str, optional :returns: the added TreeItem. :rtype: TreeItem .. _clear: .. method:: clear(self) Removes all items from the tree. .. _collapseAll: .. method:: collapseAll(self) Collapses all items. .. _ensureItemVisible: .. method:: ensureItemVisible(self, item) Scrolls view so this item is visible. :param item: TreeItem to make visible. :type item: TreeItem .. _expandAll: .. method:: expandAll(self, expanded=True) Expands (or collapses) all items. :param expanded: Determines whether to expand or not. :type expanded: bool, optional .. _get: .. method:: get(self) Returns the current selected item. .. _getChildren: .. method:: getChildren(self, parent=None) Overloaded Widget method for 'children' property. .. _getSelected: .. method:: getSelected(self) Returns a list of the selected items. .. _remove: .. method:: remove(self, item) Removes the specified item from the tree. :param item: Item to be removed. :type item: TreeItem .. _setSelected: .. method:: setSelected(self, items, selected=True, clear=True) Selects the specified items. :param items: list of TreeItems to be selected. :type items: list[TreeItems] :param selected: Determines if items will be selected or not. :type selected: bool, optional :param clear: Determines if al previously selected items will be cleared or not. :type clear: bool, optional