TreeItem (hwx.gui)#

class TreeItem(tree, parent, text, data=None, icon=None, **kwds)#

Bases: HasProperties

An item in a Tree.

Attribute Table#

Name

Type

command

NoneType

enabled

property

icon

property

selectable

property

selected

property

text

property

tooltip

property

visible

property

Method Table#

Name

Description

add (self, text, icon=None, **kwds)

Adds a TreeItem to the Tree.

clear (self)

Removes all the children from the tree.

collapse (self)

Collapse the tree item.

enableEdit (self, col, edit=True)

Makes a column of a tree item editable.

ensureVisible (self)

Ensures this TreeItem is visible.

expand (self)

Expand the tree item.

getAllChildren (self)

getChild (self, data, recursive=False)

getChildren (self)

Overloaded Widget method for ‘children’ property.

remove (self)

Removes the item from the Tree.

selectAndShow (self, clear=True)

Selects and makes this TreeItem visible.

add(text, icon=None, **kwds)#

Adds a TreeItem to the Tree.

Parameters:
  • text (str) – Text that gets displayed.

  • icon (str) – Absolute path of the icon.

Returns:

The added TreeItem.

Return type:

TreeItem

remove()#

Removes the item from the Tree.

clear()#

Removes all the children from the tree.

ensureVisible()#

Ensures this TreeItem is visible.

selectAndShow(clear=True)#

Selects and makes this TreeItem visible.

getChildren()#

Overloaded Widget method for ‘children’ property.

enableEdit(col, edit=True)#

Makes a column of a tree item editable.

Parameters:
  • col (int) – Column index needs to be make editable.

  • edit (bool) – If True, column is editable else not.

property text#

A list of text to be displayed.

property icon#

A list of icons to be displayed.

property tooltip#

The tooltip to be displayed.

property selected#

(bool) Determines whether the item is selected or not.

property enabled#

(bool) Disabled items are greyed out and don’t respond to input events.

expand()#

Expand the tree item.

collapse()#

Collapse the tree item.

property visible#

(bool) Determines whether the item is visible or not.

property selectable#

(bool) Determines whether the item can be selected or not.