MenuItem
flaui.core.automation_elements.MenuItem
Bases: AutomationElement
Class to interact with a menu item element.
is_checked
property
writable
Gets if a menu item is checked or unchecked, if checking is supported. /// For some applications, like WPF, setting this property doesn't execute the action that happens when a user clicks the menu item, only the checked state is changed. /// For WPF and Windows Forms applications, if you want to execute the action too, you need to use Invoke() method.
Returns:
| Type | Description |
|---|---|
bool
|
True if checked, else False |
is_win_menu
property
writable
Flag to indicate if the containing menu is a Win32 menu because that one needs special handling
Returns:
| Type | Description |
|---|---|
bool
|
True if the menu is Win32 model, else False |
items
property
text
property
Gets the text of the element
Returns:
| Type | Description |
|---|---|
str
|
Element text |
collapse()
expand()
get_item_by_name(name)
Gets the menu item by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the menu item |
required |
Returns:
| Type | Description |
|---|---|
MenuItem
|
MenuItem element |
Source code in flaui/core/automation_elements.py
invoke()
set_is_checked(value)
Sets if a menu item is checked or unchecked, if checking is supported. /// For some applications, like WPF, setting this property doesn't execute the action that happens when a user clicks the menu item, only the checked state is changed. /// For WPF and Windows Forms applications, if you want to execute the action too, you need to use Invoke() method.
:value: Flag to set
Returns:
| Type | Description |
|---|---|
None
|
None |