Actions and Menus

Classes

class keysight.ads.de.app.Action

Bases: object

__init__(title: str, callback: Callable[[Action, Window], None], ui_callback: Callable[[Action, Window], MenuState] | None = None)

Create an action item.

Parameters:
  • title (str) – The title of the action item

  • callback (function) – A function to be called when the menu/action is triggered of signature function(arg : Action, win : Window)

  • ui_callback (function) – A function called to set the menu/action state function(arg : Action, win : Window)

Example:

>>> def my_callback(action, window_handle):
...     print(f'Called from {action} with {window_handle}')
>>> menu = Action('Test', my_callback, None)
is_checkable() bool
is_separator() bool
property name: str
property original_shortcut: str
property shortcut: str
property tooltip: str
class keysight.ads.de.app.Separator

Bases: Action

__init__()

Create a separator.

Example:

>>> sep = Separator()
class keysight.ads.de.app.Menu

Bases: Action

__init__(title: str)

Create a menu.

Parameters:

title (str) – The title of the action item

Example:

>>> menu = Menu('Test')
property actions: NamedItemCollectionAbc[Action]
add_action(new_action: Action) None
add_menu(new_menu: Menu) None
find_action(name: str) Action | None
find_menu(name: str) Menu | None
insert_action(new_action: Action, index: int) bool
insert_menu(new_menu: Menu, index: int) bool
property menus: NamedItemCollectionAbc[Menu]
remove_action(existing_action: Action) None
remove_all_menus() None
remove_menu(existing_menu: Menu) None
class keysight.ads.de.app.MenuBar

Bases: Menu

A menubar, usually at the top of a window.

class keysight.ads.de.app.PopupMenu

Bases: Menu

__init__()

Create a pop-up menu.

Example:

>>> menu = PopupMenu()
>>> menu.add_action(...)
>>> menu.add_menu(..)

Enumerated Types

class keysight.ads.de.app.MenuState

Bases: IntFlag

SENSITIVE = 1
INSENSITIVE = 2
TOGGLE_ON = 4
TOGGLE_OFF = 8
__new__(value)
On this page