gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.ActionMenuToolbar.Action

Contents

- Detail
- Class Hierarchy
- Types
- Constructors
- Methods
- Attributes
- Signals
- Deprecated

Description

An action which can be triggered by a menu or toolbar item

- Module available since Gtk+ version 2.4

Synopsis

- data Action
- class GObjectClass o => ActionClass o
- castToAction :: GObjectClass obj => obj -> Action
- gTypeAction :: GType
- toAction :: ActionClass o => o -> Action
- actionNew :: GlibString string => string -> string -> Maybe string -> Maybe StockId -> IO Action
- actionGetName :: (ActionClass self, GlibString string) => self -> IO string
- actionIsSensitive :: ActionClass self => self -> IO Bool
- actionGetSensitive :: ActionClass self => self -> IO Bool
- actionSetSensitive :: ActionClass self => self -> Bool -> IO ()
- actionIsVisible :: ActionClass self => self -> IO Bool
- actionGetVisible :: ActionClass self => self -> IO Bool
- actionSetVisible :: ActionClass self => self -> Bool -> IO ()
- actionActivate :: ActionClass self => self -> IO ()
- actionCreateMenuItem :: ActionClass self => self -> IO Widget
- actionCreateToolItem :: ActionClass self => self -> IO Widget
- actionGetProxies :: ActionClass self => self -> IO [Widget]
- actionConnectAccelerator :: ActionClass self => self -> IO ()
- actionDisconnectAccelerator :: ActionClass self => self -> IO ()
- actionGetAccelPath :: (ActionClass self, GlibString string) => self -> IO (Maybe string)
- actionSetAccelPath :: (ActionClass self, GlibString string) => self -> string -> IO ()
- actionSetAccelGroup :: ActionClass self => self -> AccelGroup -> IO ()
- actionName :: (GlibString string, ActionClass self) => Attr self string
- actionLabel :: (GlibString string, ActionClass self) => Attr self string
- actionShortLabel :: (GlibString string, ActionClass self) => Attr self string
- actionTooltip :: (GlibString string, ActionClass self) => Attr self (Maybe string)
- actionStockId :: (GlibString string, ActionClass self) => Attr self (Maybe string)
- actionVisibleHorizontal :: ActionClass self => Attr self Bool
- actionVisibleOverflown :: ActionClass self => Attr self Bool
- actionVisibleVertical :: ActionClass self => Attr self Bool
- actionIsImportant :: ActionClass self => Attr self Bool
- actionHideIfEmpty :: ActionClass self => Attr self Bool
- actionSensitive :: ActionClass self => Attr self Bool
- actionVisible :: ActionClass self => Attr self Bool
- actionAccelPath :: (GlibString string, ActionClass self) => ReadWriteAttr self (Maybe string) string
- actionAlwaysShowImage :: ActionClass self => Attr self Bool
- actionActivated :: ActionClass self => Signal self (IO ())

# Detail

Actions represent operations that the user can be perform, along with some information how it should be presented in the interface. Each action provides methods to create icons, menu items and toolbar items representing itself.

As well as the callback that is called when the action gets activated, the following also gets associated with the action:

- a name (not translated, for path lookup)
- a label (translated, for display)
- an accelerator
- whether label indicates a stock id
- a tooltip (optional, translated)
- a toolbar label (optional, shorter than label)

The action will also have some state information:

- visible (shown/hidden)
- sensitive (enabled/disabled)

Apart from regular actions, there are toggle actions, which can be toggled between two states and radio actions, of which only one in a group can be in the "active" state. Other actions can be implemented as `Action` subclasses.

Each action can have one or more proxy menu item, toolbar button or other proxy widgets. Proxies mirror the state of the action (text label, tooltip, icon, visible, sensitive, etc), and should change when the action's state changes. When the proxy is activated, it should activate its action.

# Class Hierarchy

    | GObject
    | +----Action
    | +----ToggleAction

# Types

data Action Source #

#### Instances

Instances details

Eq Action Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: Action -> Action -> Bool Source # (/=) :: Action -> Action -> Bool Source #
Ord Action Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods compare :: Action -> Action -> Ordering Source # (<) :: Action -> Action -> Bool Source # (<=) :: Action -> Action -> Bool Source # (>) :: Action -> Action -> Bool Source # (>=) :: Action -> Action -> Bool Source # max :: Action -> Action -> Action Source # min :: Action -> Action -> Action Source #
GObjectClass Action Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: Action -> GObject Source # unsafeCastGObject :: GObject -> Action Source #
ActionClass Action Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class GObjectClass o => ActionClass o Source #

#### Instances

Instances details

ActionClass Action Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ActionClass RadioAction Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ActionClass RecentAction Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ActionClass ToggleAction Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToAction :: GObjectClass obj => obj -> Action Source #

gTypeAction :: GType Source #

toAction :: ActionClass o => o -> Action Source #

# Constructors

actionNew Source #

Arguments

:: GlibString string |
=> string | `name` - A unique name for the action
-> string | `label` - the label displayed in menu items and on buttons
-> Maybe string | `tooltip` - a tooltip for the action
-> Maybe StockId | `stockId` - the stock icon to display in widgets representing the action
-> IO Action |

Creates a new `Action` object. To add the action to a `ActionGroup` and set the accelerator for the action, call `actionGroupAddActionWithAccel`. See Graphics.UI.Gtk.ActionMenuToolbar.UIManager for information on allowed action names.

# Methods

actionGetName :: (ActionClass self, GlibString string) => self -> IO string Source #

Returns the name of the action.

actionIsSensitive Source #

Arguments

:: ActionClass self |
=> self |
-> IO Bool | returns `True` if the action and its associated action group are both sensitive.

Returns whether the action is effectively sensitive.

actionGetSensitive Source #

Arguments

:: ActionClass self |
=> self |
-> IO Bool | returns `True` if the action itself is sensitive.

Returns whether the action itself is sensitive. Note that this doesn't necessarily mean effective sensitivity. See `actionIsSensitive` for that.

actionSetSensitive Source #

Arguments

:: ActionClass self |
=> self |
-> Bool | `sensitive` - `True` to make the action sensitive
-> IO () |

Sets the sensitive property of the action to `sensitive`. Note that this doesn't necessarily mean effective sensitivity. See `actionIsSensitive` for that.

- Available since Gtk+ version 2.6

actionIsVisible Source #

Arguments

:: ActionClass self |
=> self |
-> IO Bool | returns `True` if the action and its associated action group are both visible.

Returns whether the action is effectively visible.

actionGetVisible Source #

Arguments

:: ActionClass self |
=> self |
-> IO Bool | returns `True` if the action itself is visible.

Returns whether the action itself is visible. Note that this doesn't necessarily mean effective visibility. See `actionIsSensitive` for that.

actionSetVisible Source #

Arguments

:: ActionClass self |
=> self |
-> Bool | `visible` - `True` to make the action visible
-> IO () |

Sets the visible property of the action to `visible`. Note that this doesn't necessarily mean effective visibility. See `actionIsVisible` for that.

- Available since Gtk+ version 2.6

actionActivate :: ActionClass self => self -> IO () Source #

Emits the "activate" signal on the specified action, if it isn't insensitive. This gets called by the proxy widgets when they get activated.

It can also be used to manually activate an action.

actionCreateMenuItem Source #

Arguments

:: ActionClass self |
=> self |
-> IO Widget | returns a menu item connected to the action.

Creates a menu item widget that proxies for the given action.

actionCreateToolItem Source #

Arguments

:: ActionClass self |
=> self |
-> IO Widget | returns a toolbar item connected to the action.

Creates a toolbar item widget that proxies for the given action.

actionGetProxies :: ActionClass self => self -> IO [Widget] Source #

Returns the proxy widgets for an action.

actionConnectAccelerator :: ActionClass self => self -> IO () Source #

Installs the accelerator for `action` if `action` has an accel path and group. See `actionSetAccelPath` and `actionSetAccelGroup`

Since multiple proxies may independently trigger the installation of the accelerator, the `action` counts the number of times this function has been called and doesn't remove the accelerator until `actionDisconnectAccelerator` has been called as many times.

actionDisconnectAccelerator :: ActionClass self => self -> IO () Source #

Undoes the effect of one call to `actionConnectAccelerator`.

actionGetAccelPath Source #

Arguments

:: (ActionClass self, GlibString string) |
=> self |
-> IO (Maybe string) | returns the accel path for this action, or `Nothing` if none is set.

Returns the accel path for this action.

- Available since Gtk+ version 2.6

actionSetAccelPath Source #

Arguments

:: (ActionClass self, GlibString string) |
=> self |
-> string | `accelPath` - the accelerator path
-> IO () |

Sets the accel path for this action. All proxy widgets associated with the action will have this accel path, so that their accelerators are consistent.

actionSetAccelGroup :: ActionClass self => self -> AccelGroup -> IO () Source #

Sets the `AccelGroup` in which the accelerator for this action will be installed.

# Attributes

actionName :: (GlibString string, ActionClass self) => Attr self string Source #

A unique name for the action.

Default value: ""

actionLabel :: (GlibString string, ActionClass self) => Attr self string Source #

The label used for menu items and buttons that activate this action.

Default value: ""

actionShortLabel :: (GlibString string, ActionClass self) => Attr self string Source #

A shorter label that may be used on toolbar buttons.

Default value: ""

actionTooltip :: (GlibString string, ActionClass self) => Attr self (Maybe string) Source #

A tooltip for this action.

Default value: `Nothing`

actionStockId :: (GlibString string, ActionClass self) => Attr self (Maybe string) Source #

The stock icon displayed in widgets representing this action.

Default value: `Nothing`

actionVisibleHorizontal :: ActionClass self => Attr self Bool Source #

Whether the toolbar item is visible when the toolbar is in a horizontal orientation.

Default value: `True`

actionVisibleOverflown :: ActionClass self => Attr self Bool Source #

When `True`, toolitem proxies for this action are represented in the toolbar overflow menu.

Default value: `True`

- Available since Gtk+ version 2.6

actionVisibleVertical :: ActionClass self => Attr self Bool Source #

Whether the toolbar item is visible when the toolbar is in a vertical orientation.

Default value: `True`

actionIsImportant :: ActionClass self => Attr self Bool Source #

Whether the action is considered important. When `True`, toolitem proxies for this action show text in `ToolbarBothHoriz` mode.

Default value: `False`

actionHideIfEmpty :: ActionClass self => Attr self Bool Source #

When `True`, empty menu proxies for this action are hidden.

Default value: `True`

actionSensitive :: ActionClass self => Attr self Bool Source #

Whether the action is enabled.

Default value: `True`

- Available since Gtk+ version 2.6

actionVisible :: ActionClass self => Attr self Bool Source #

Whether the action is visible.

Default value: `True`

- Available since Gtk+ version 2.6

actionAccelPath :: (GlibString string, ActionClass self) => ReadWriteAttr self (Maybe string) string Source #

'accelPath' property. See `actionGetAccelPath` and `actionSetAccelPath`

- Available since Gtk+ version 2.6

actionAlwaysShowImage :: ActionClass self => Attr self Bool Source #

If `True`, the action's menu item proxies will ignore the `menuImages` setting and always show their image, if available.

Use this property if the menu item would be useless or hard to use without their image.

Default value: `False`

Since 2.20

# Signals

actionActivated :: ActionClass self => Signal self (IO ()) Source #

The "activate" signal is emitted when the action is activated.

# Deprecated