__init__(self,
name,
callback,
label=None,
description=None,
icon=None)
(Constructor)
| source code
|
Initialize the action. The name must be provided and must be unique
from all other actions in the editor. This includes plugins, so
plugin-developers are encouraged to watch their namespace. For example,
prepend the name of your plugin to all actions the plugin might define. A
callback function that takes one argument (may be None) must also be
supplied unless the Action class has been subclassed and the invoke
method has been overridden.
A label, description, and icon can also be provided. The label serves
two purposes: First, it behaves as a flag that this is an end-user action
as opposed to an action for communication betwen plugins. If it is set to
None, then it is an internal action. Second it provides a label that will
be displayed to end users in identifying the action in action lists or in
adding the action to menus or other visible items. The description is
optional, but highly recommended for user-visible actions. It is used to
describe the action in action lists or as a mouse tooltip for menuitems,
toolbars, and the like. Finally, an optional icon can be specified to be
associated with the action in gui menus or toolbars.
- Overrides:
object.__init__
|