gtk.ActionGroupa group of actions (new in PyGTK 2.4)Synopsisgtk.ActionGroupgobject.GObjectgtk.ActionGroupnameget_nameget_sensitiveset_sensitivesensitiveget_visibleset_visiblevisibleget_actionaction_namelist_actionsadd_actionactionadd_action_with_accelactionacceleratorremove_actionactionadd_actionsentriesuser_dataNoneadd_toggle_actionsentriesuser_dataNoneadd_radio_actionsentriesvalue0on_changeNoneuser_dataNoneset_translation_domaindomaintranslate_stringstringAncestry+-- gobject.GObject
+-- gtk.ActionGroup
Implemented Interfacesgtk.ActionGroup
implements
gtk.Buildablegtk.ActionGroup Properties
"name"Read-WriteA name for the action group."sensitive"Read-WriteIf True, the action group is
enabled."visible"Read-WriteIf True, the action group is
visible.
gtk.ActionGroup Signal Prototypesgobject.GObject Signal Prototypes"connect-proxy"callbackactiongroupactionproxyuser_param1..."disconnect-proxy"callbackactiongroupactionproxyuser_param1..."post-activate"callbackactiongroupactionuser_param1..."pre-activate"callbackactiongroupactionuser_param1...DescriptionThis object is available in PyGTK 2.4 and above.gtk.Action objects
are organized into gtk.ActionGroup
objects. An action group is basically a map from names to gtk.Action
objects.All actions that would make sense to use in a particular context
should be in a single action group. Multiple action groups may be used for a
particular user interface. In fact, it is expected that most nontrivial
applications will make use of multiple groups. For example, in an
application that can edit multiple documents, there could be one group
holding global actions (e.g. quit, about, new), and one group per document
holding actions that act on that document (e.g. save, cut/copy/paste,
etc). Each window's menus would be constructed from a combination of the two
action groups.Accelerators are handled by the GTK+ accelerator map. All actions
are assigned an accelerator path (which normally has the form
"<Actions>/group-name/action-name") and a shortcut is associated with
this accelerator path. All menuitems and toolitems take on this accelerator
path. The GTK+ accelerator map code makes sure that the correct shortcut is
displayed next to the menu item.Constructorgtk.ActionGroupnamename :the name of the action group.Returns :the new gtk.ActionGroupThis constructor is available in PyGTK 2.4 and above.Creates a new gtk.ActionGroup
object with the name specified by name. The name of
the action group is used when associating keybindings with the
actions.Methodsgtk.ActionGroup.get_nameget_nameReturns :the name of the action
group.This method is available in PyGTK 2.4 and above.The get_name() method returns the value
of the "name" property that contains the name of the action group.gtk.ActionGroup.get_sensitiveget_sensitiveReturns :True if the group is
sensitive.This method is available in PyGTK 2.4 and above.The get_sensitive() method returns the
value of the "sensitive" property. If "sensitive" is True
the group is enabled. The constituent actions can only be logically
sensitive (see the gtk.Action.is_sensitive()
method) if they are sensitive (see the gtk.Action.get_sensitive()
method) and their group is sensitive.gtk.ActionGroup.set_sensitiveset_sensitivesensitivesensitive :if True, the group is
enabledThis method is available in PyGTK 2.4 and above.The set_sensitive() method sets the
"sensitive" property to the value of
sensitive. If sensitive
is True, the gtk.ActionGroup
is enabled.gtk.ActionGroup.get_visibleget_visibleReturns :True if the group is
visible.This method is available in PyGTK 2.4 and above.The get_visible() method returns the
value of the "visible" property. If "visible" is True,
the group is visible. The constituent actions can only be logically visible
(see the gtk.Action.is_visible()
method) if they are visible (see the gtk.Action.get_visible()
method) and their group is visible.gtk.ActionGroup.set_visibleset_visiblevisiblevisible :if True, the group will be
visibleThis method is available in PyGTK 2.4 and above.The set_visible() method sets the
"visible" property to the value of visible. If
visible is True the gtk.ActionGroup
will be visible.gtk.ActionGroup.get_actionget_actionaction_nameaction_name :the name of the actionReturns :the action, or None if no
action with that name exists.This method is available in PyGTK 2.4 and above.The get_action() method retrieves the
action in the action group with the name specified by
action_name.gtk.ActionGroup.list_actionslist_actionsReturns :a list of the action objects in the action
groupThis method is available in PyGTK 2.4 and above.The list_action() method returns a list
containing the gtk.Action objects
in the action group.gtk.ActionGroup.add_actionadd_actionactionaction :an actionThis method is available in PyGTK 2.4 and above.The add_action() method adds the gtk.Action specified
by action to the action group.gtk.ActionGroup.add_action_with_acceladd_action_with_accelactionacceleratoraction :the action to addaccelerator :the accelerator for the action, in the format
understood by the gtk.accelerator_parse()
function, or None to use the stock
acceleratorThis method is available in PyGTK 2.4 and above.The add_action_with_accel() method adds
a gtk.Action
specified by action to the action group and sets up
the accelerator specified by accelerator.If accelerator is
None, this method attempts to use the accelerator
associated with the "stock_id" property of the gtk.Action.Accel paths are set to
<Actions>/group-name/action-name.gtk.ActionGroup.remove_actionremove_actionactionaction :a gtk.ActionThis method is available in PyGTK 2.4 and above.The remove_action() method removes the
gtk.Action
specified by action from the action group.gtk.ActionGroup.add_actionsadd_actionsentriesuser_dataNoneentries :a list or tuple of action
descriptionsuser_data :data to pass to the action
callbacksThis method is available in PyGTK 2.4 and above.The add_actions() method is a
convenience method that creates a number of gtk.Action objects
based on the information in the list of action entry tuples contained in
entries and adds them to the action group. The entry
tuples can vary in size from one to six items with the following
information:The name of the action. Must be specified.The stock id for the action. Optional with a default
value of None if a label is specified.The label for the action. This field should typically be
marked for translation, see the set_translation_domain()
method. Optional with a default value of None if a stock
id is specified.The accelerator for the action, in the format understood by
the gtk.accelerator_parse()
function. Optional with a default value of
None.The tooltip for the action. This field should typically be
marked for translation, see the set_translation_domain()
method. Optional with a default value of None.The callback function invoked when the action is
activated. Optional with a default value of
None.The "activate" signals of the actions are connected to the
callbacks and their accel paths are set to
<Actions>/group-name/action-name.gtk.ActionGroup.add_toggle_actionsadd_toggle_actionsentriesuser_dataNoneentries :a list or tuple of toggle action entry
tuplesuser_data :data to pass to the action
callbacksThis method is available in PyGTK 2.4 and above.The add_toggle_actions() method is a
convenience method that creates a number of gtk.ToggleAction
objects based on the information in the list of action entry tuples
contained in entries and adds them to the action
group. The toggle action entry tuples can vary in size from one to seven items
with the following information:The name of the action. Must be specified.The stock id for the action. Optional with a default
value of None if a label is specified.The label for the action. This field should typically be
marked for translation, see the set_translation_domain()
method. Optional with a default value of None if a stock
id is specified.The accelerator for the action, in the format understood by
the gtk.accelerator_parse()
function. Optional with a default value of
None.The tooltip for the action. This field should typically be
marked for translation, see the set_translation_domain()
method. Optional with a default value of None.The callback function invoked when the action is
activated. Optional with a default value of
None.A flag indicating whether the toggle action is
active. Optional with a default value of False.The "activate" signals of the actions are connected to the
callbacks and their accel paths are set to
<Actions>/group-name/action-name.gtk.ActionGroup.add_radio_actionsadd_radio_actionsentriesvalue0on_changeNoneuser_dataNoneentries :a list or tuple of radio action entry
tuplesvalue :the value of the radio action to set
activeon_change :a callback to connect to the "changed" signal
of the first radio actionuser_data :data to pass to the
on_change callbackThis method is available in PyGTK 2.4 and above.The add_radio_actions() method is a
convenience method that creates a number of gtk.RadioAction
objects based on the information in the list of action entry tuples
contained in entries and adds them to the action
group. The entry tuples can vary in size from one to six items with the
following information:The name of the action. Must be specified.The stock id for the action. Optional with a default
value of None if a label is specified.The label for the action. This field should typically be
marked for translation, see the set_translation_domain()
method. Optional with a default value of None if a stock
id is specified.The accelerator for the action, in the format understood by
the gtk.accelerator_parse()
function. Optional with a default value of
None.The tooltip for the action. This field should typically be
marked for translation, see the set_translation_domain()
method. Optional with a default value of None.The value to set on the radio action. Optional with a
default value of 0. Should be specified in
applications.The value parameter specifies the radio
action that should be set active. The "changed" signal of the first radio
action is connected to the on_change callback (if
specified and not None) and the accel paths of the
actions are set to
<Actions>/group-name/action-name.gtk.ActionGroup.set_translation_domainset_translation_domaindomaindomain :the translation domain to use for
dgettext() callsThis method is available in PyGTK 2.4 and above.The set_translation_domain() method
sets the translation domain to the string specified by
domain and uses dgettext()
for translating the label and
tooltip strings of the actions added by the add_actions(),
add_toggle_actions()
and add_radio_actions()
methods.gtk.ActionGroup.translate_stringtranslate_stringstringstring :the string to be translatedReturns :the translation of
stringThis method is available in PyGTK 2.6 and above.The translate_string() method
translates the string specified by string using the
specified translate_func(). This is mainly intended for
language bindings.SignalsThe "connect-proxy" gtk.ActionGroup Signalcallbackactiongroupactionproxyuser_param1...actiongroup :the actiongroup that received the
signalaction :the action that is associated with
proxyproxy :the proxy widget associated with
actionuser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)This signal is available in PyGTK 2.4 and above.The "connect-proxy" signal is emitted when the widget specified
by proxy is connected to the gtk.Action specified
by action.The "disconnect-proxy" gtk.ActionGroup Signalcallbackactiongroupactionproxyuser_param1...actiongroup :the actiongroup that received the
signalaction :the action that is associated with
proxyproxy :the proxy widget associated with
actionuser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)This signal is available in PyGTK 2.4 and above.The "disconnect-proxy" signal is emitted when the widget
specified by proxy is disconnected from the gtk.Action specified
by action.The "post-activate" gtk.ActionGroup Signalcallbackactiongroupactionuser_param1...actiongroup :the actiongroup that received the
signalaction :the action that is being
activateduser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)This signal is available in PyGTK 2.4 and above.The "post-activate" signal is emitted after the gtk.Action specified
by action has been activated.The "pre-activate" gtk.ActionGroup Signalcallbackactiongroupactionuser_param1...actiongroup :the actiongroup that received the
signalaction :the action that is being
activateduser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)This signal is available in PyGTK 2.4 and above.The "pre-activate" signal is emitted before the gtk.Action specified
by action is activated.