Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Name

qaddaction — add action to widget

Syntax

Panel
bgColor#FFFFAA
borderWidth1
borderStylesolid

qaddaction widget [action]
qaddaction widget name commands

Description

The qaddaction command adds a qaction object to a widget. Widgets may handle this differently. Instances of qwidget will display their actions in a right-click menu, while QMenuswill have their actions listed as menu items.

Arguments

widget

The target widget to receive the action object. This may be any widget.

action

An instance of qaction

name

The name of the menu item.

commands

Tcl commands to be executed when the user selects the menu item.

Examples

Adding an action to a menu

No Format
bgColor#eeeeee
borderWidth1
# 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!" }

{noformat}

See [qmainwindow] for examples on how to use the *qaddaction* command. See the [qaction] command for information on how to create action objects. 

See qmainwindow for examples on how to use the qaddaction command. See the qaction command for information on how to create action objects.