gi-gtk-3.0.11: Gtk bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.ActionGroup

Contents

Description

Actions are organised into groups. An action group is essentially a map from names to Action objects.

All actions that would make sense to use in a particular context should be in a single 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, one group holding global actions (e.g. quit, about, new), and one group per document holding actions that act on that document (eg. save, cut/copy/paste, etc). Each window’s menus would be constructed from a combination of two action groups.

## {Action-Accel}

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.

{ActionGroup-BUILDER-UI}

The ActionGroup implementation of the Buildable interface accepts Action objects as <child> elements in UI definitions.

Note that it is probably more common to define actions and action groups in the code, since they are directly related to what the code can do.

The GtkActionGroup implementation of the GtkBuildable interface supports a custom <accelerator> element, which has attributes named “key“ and “modifiers“ and allows to specify accelerators. This is similar to the <accelerator> element of Widget, the main difference is that it doesn’t allow you to specify a signal.

## > >class="GtkActionGroup" id="actiongroup" > child > class="GtkAction" id="About" > name="name"About/property > name="stock_id"gtk-about/property > handler="about_activate" name="activate"/ > /object > key="F1" modifiers="GDK_CONTROL_MASK | GDK_SHIFT_MASK"/ > /child >/object

Synopsis

Exported types

Methods

addAction

actionGroupAddAction Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionGroup a, IsAction b) 
=> a

actionGroup: the action group

-> b

action: an action

-> m () 

Deprecated: (Since version 3.10)

Adds an action object to the action group. Note that this function does not set up the accel path of the action, which can lead to problems if a user tries to modify the accelerator of a menuitem associated with the action. Therefore you must either set the accel path yourself with actionSetAccelPath, or use gtk_action_group_add_action_with_accel (..., NULL).

Since: 2.4

addActionWithAccel

actionGroupAddActionWithAccel Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionGroup a, IsAction b) 
=> a

actionGroup: the action group

-> b

action: the action to add

-> Maybe Text

accelerator: the accelerator for the action, in the format understood by acceleratorParse, or "" for no accelerator, or Nothing to use the stock accelerator

-> m () 

Deprecated: (Since version 3.10)

Adds an action object to the action group and sets up the accelerator.

If accelerator is Nothing, attempts to use the accelerator associated with the stock_id of the action.

Accel paths are set to <Actions>/group-name/action-name.

Since: 2.4

getAccelGroup

actionGroupGetAccelGroup Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionGroup a) 
=> a

actionGroup: a ActionGroup

-> m AccelGroup

Returns: the accelerator group associated with this action group or Nothing if there is none.

Deprecated: (Since version 3.10)

Gets the accelerator group.

Since: 3.6

getAction

actionGroupGetAction Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionGroup a) 
=> a

actionGroup: the action group

-> Text

actionName: the name of the action

-> m Action

Returns: the action, or Nothing if no action by that name exists

Deprecated: (Since version 3.10)

Looks up an action in the action group by name.

Since: 2.4

getName

actionGroupGetName Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionGroup a) 
=> a

actionGroup: the action group

-> m Text

Returns: the name of the action group.

Deprecated: (Since version 3.10)

Gets the name of the action group.

Since: 2.4

getSensitive

actionGroupGetSensitive Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionGroup a) 
=> a

actionGroup: the action group

-> m Bool

Returns: True if the group is sensitive.

Deprecated: (Since version 3.10)

Returns True if the group is sensitive. The constituent actions can only be logically sensitive (see actionIsSensitive) if they are sensitive (see actionGetSensitive) and their group is sensitive.

Since: 2.4

getVisible

actionGroupGetVisible Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionGroup a) 
=> a

actionGroup: the action group

-> m Bool

Returns: True if the group is visible.

Deprecated: (Since version 3.10)

Returns True if the group is visible. The constituent actions can only be logically visible (see actionIsVisible) if they are visible (see actionGetVisible) and their group is visible.

Since: 2.4

listActions

actionGroupListActions Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionGroup a) 
=> a

actionGroup: the action group

-> m [Action]

Returns: an allocated list of the action objects in the action group

Deprecated: (Since version 3.10)

Lists the actions in the action group.

Since: 2.4

new

actionGroupNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

name: the name of the action group.

-> m ActionGroup

Returns: the new ActionGroup

Deprecated: (Since version 3.10)

Creates a new ActionGroup object. The name of the action group is used when associating [keybindings][Action-Accel] with the actions.

Since: 2.4

removeAction

actionGroupRemoveAction Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionGroup a, IsAction b) 
=> a

actionGroup: the action group

-> b

action: an action

-> m () 

Deprecated: (Since version 3.10)

Removes an action object from the action group.

Since: 2.4

setAccelGroup

actionGroupSetAccelGroup Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionGroup a, IsAccelGroup b) 
=> a

actionGroup: a ActionGroup

-> Maybe b

accelGroup: a AccelGroup to set or Nothing

-> m () 

Deprecated: (Since version 3.10)

Sets the accelerator group to be used by every action in this group.

Since: 3.6

setSensitive

actionGroupSetSensitive Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionGroup a) 
=> a

actionGroup: the action group

-> Bool

sensitive: new sensitivity

-> m () 

Deprecated: (Since version 3.10)

Changes the sensitivity of actionGroup

Since: 2.4

setTranslateFunc

actionGroupSetTranslateFunc Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionGroup a) 
=> a

actionGroup: a ActionGroup

-> TranslateFunc

func: a TranslateFunc

-> m () 

Deprecated: (Since version 3.10)

Sets a function to be used for translating the label and tooltip of GtkActionEntrys added by gtk_action_group_add_actions().

If you’re using gettext(), it is enough to set the translation domain with actionGroupSetTranslationDomain.

Since: 2.4

setTranslationDomain

actionGroupSetTranslationDomain Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionGroup a) 
=> a

actionGroup: a ActionGroup

-> Maybe Text

domain: the translation domain to use for dgettext calls, or Nothing to use the domain set with textdomain()

-> m () 

Deprecated: (Since version 3.10)

Sets the translation domain and uses dgettext for translating the label and tooltip of GtkActionEntrys added by gtk_action_group_add_actions().

If you’re not using gettext() for localization, see actionGroupSetTranslateFunc.

Since: 2.4

setVisible

actionGroupSetVisible Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionGroup a) 
=> a

actionGroup: the action group

-> Bool

visible: new visiblity

-> m () 

Deprecated: (Since version 3.10)

Changes the visible of actionGroup.

Since: 2.4

translateString

actionGroupTranslateString Source #

Arguments

:: (HasCallStack, MonadIO m, IsActionGroup a) 
=> a

actionGroup: a ActionGroup

-> Text

string: a string

-> m Text

Returns: the translation of string

Deprecated: (Since version 3.10)

Translates a string using the function set with actionGroupSetTranslateFunc. This is mainly intended for language bindings.

Since: 2.6

Properties

accelGroup

data ActionGroupAccelGroupPropertyInfo Source #

Instances

AttrInfo ActionGroupAccelGroupPropertyInfo Source # 
type AttrOrigin ActionGroupAccelGroupPropertyInfo Source # 
type AttrLabel ActionGroupAccelGroupPropertyInfo Source # 
type AttrGetType ActionGroupAccelGroupPropertyInfo Source # 
type AttrBaseTypeConstraint ActionGroupAccelGroupPropertyInfo Source # 
type AttrSetTypeConstraint ActionGroupAccelGroupPropertyInfo Source # 
type AttrAllowedOps ActionGroupAccelGroupPropertyInfo Source # 

name

data ActionGroupNamePropertyInfo Source #

Instances

AttrInfo ActionGroupNamePropertyInfo Source # 
type AttrOrigin ActionGroupNamePropertyInfo Source # 
type AttrLabel ActionGroupNamePropertyInfo Source # 
type AttrGetType ActionGroupNamePropertyInfo Source # 
type AttrBaseTypeConstraint ActionGroupNamePropertyInfo Source # 
type AttrSetTypeConstraint ActionGroupNamePropertyInfo Source # 
type AttrAllowedOps ActionGroupNamePropertyInfo Source # 

sensitive

data ActionGroupSensitivePropertyInfo Source #

Instances

AttrInfo ActionGroupSensitivePropertyInfo Source # 
type AttrOrigin ActionGroupSensitivePropertyInfo Source # 
type AttrLabel ActionGroupSensitivePropertyInfo Source # 
type AttrGetType ActionGroupSensitivePropertyInfo Source # 
type AttrBaseTypeConstraint ActionGroupSensitivePropertyInfo Source # 
type AttrSetTypeConstraint ActionGroupSensitivePropertyInfo Source # 
type AttrAllowedOps ActionGroupSensitivePropertyInfo Source # 

visible

data ActionGroupVisiblePropertyInfo Source #

Instances

AttrInfo ActionGroupVisiblePropertyInfo Source # 
type AttrOrigin ActionGroupVisiblePropertyInfo Source # 
type AttrLabel ActionGroupVisiblePropertyInfo Source # 
type AttrGetType ActionGroupVisiblePropertyInfo Source # 
type AttrBaseTypeConstraint ActionGroupVisiblePropertyInfo Source # 
type AttrSetTypeConstraint ActionGroupVisiblePropertyInfo Source # 
type AttrAllowedOps ActionGroupVisiblePropertyInfo Source # 

Signals

connectProxy

type ActionGroupConnectProxyCallback = Action -> Widget -> IO () Source #

Deprecated: (Since version 3.10)

disconnectProxy

type ActionGroupDisconnectProxyCallback = Action -> Widget -> IO () Source #

Deprecated: (Since version 3.10)

postActivate

type ActionGroupPostActivateCallback = Action -> IO () Source #

Deprecated: (Since version 3.10)

preActivate

type ActionGroupPreActivateCallback = Action -> IO () Source #

Deprecated: (Since version 3.10)