Unknown macro: {alias}
Name
qaddaction — add action to widget
Syntax
qaddaction widget [action]
qaddaction widget name commands
Description
The qaddaction command adds a [qQAction] object to a widget. Widgets may handle this differently. Instances of qwidget will display their actions in a right-click menu, while [QMenus] will have their actions listed as menu items.
Arguments
widget
Unknown macro: {indent}
The target widget to receive the action object. This may be any widget.
action
Unknown macro: {indent}
An instance of qaction.
name
Unknown macro: {indent}
The name of the menu item.
commands
Unknown macro: {indent}
Tcl commands to be executed when the user selects the menu item.
Unknown macro: {indent}
Examples
Adding an action to a menu
# Get the Geocap help menu. This could be any menu set helpmenu [mainwindow helpmenu] # Add an item named "Hello" to the menu. The commands are the statements found inside the braces. qaddaction $helpmenu "Hello" { qinformation Hello "Hello there!" }
See qmainwindow for examples on how to use the qaddaction command. See the qaction command for information on how to create action objects.