Skip to content

TreeItem

flaui.core.automation_elements.TreeItem

Bases: AutomationElement

Class to interact with a treeitem element.

expand_collapse_state property

Gets the current expand / collapse state.

Returns:

Type Description
ExpandCollapseState

Current state enum object

is_checked property writable

Gets if the tree item is checked, if checking is supported.

Returns:

Type Description
bool

True if checked else False

is_selected property

Value to get/set if this element is selected.

Returns:

Type Description
bool

True if selected else False

items property

All child TreeItem" /> objects from this TreeItem" />.

Returns:

Type Description
List[TreeItem]

List of TreeItem elements

text property

The text of the TreeItem" />.

Returns:

Type Description
str

Text value of element

add_to_selection()

Add the element to the selection.

Returns:

Type Description
TreeItem

TreeItem element

Source code in flaui/core/automation_elements.py
@handle_csharp_exceptions
def add_to_selection(self) -> TreeItem:
    """Add the element to the selection.

    :return: TreeItem element
    """
    return TreeItem(raw_element=self.raw_element.AddToSelection())

collapse()

Collapses the element.

Source code in flaui/core/automation_elements.py
@handle_csharp_exceptions
def collapse(self):
    """Collapses the element."""
    self.raw_element.Collapse()

expand()

Expands the element.

Source code in flaui/core/automation_elements.py
@handle_csharp_exceptions
def expand(self):
    """Expands the element."""
    self.raw_element.Expand()

remove_from_selection()

Remove the element to the selection.

Returns:

Type Description
TreeItem

TreeItem element

Source code in flaui/core/automation_elements.py
@handle_csharp_exceptions
def remove_from_selection(self) -> TreeItem:
    """Remove the element to the selection.

    :return: TreeItem element
    """
    return TreeItem(raw_element=self.raw_element.RemoveFromSelection())

select()

Selects the element.

Source code in flaui/core/automation_elements.py
@handle_csharp_exceptions
def select(self):
    """Selects the element."""
    self.raw_element.Select()