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.Display.AccelLabel

Contents

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

Description

A label which displays an accelerator key on the right of the text

Synopsis

- data AccelLabel
- class LabelClass o => AccelLabelClass o
- castToAccelLabel :: GObjectClass obj => obj -> AccelLabel
- gTypeAccelLabel :: GType
- toAccelLabel :: AccelLabelClass o => o -> AccelLabel
- accelLabelNew :: GlibString string => string -> IO AccelLabel
- accelLabelSetAccelWidget :: (AccelLabelClass self, WidgetClass accelWidget) => self -> accelWidget -> IO ()
- accelLabelGetAccelWidget :: AccelLabelClass self => self -> IO (Maybe Widget)
- accelLabelAccelWidget :: (AccelLabelClass self, WidgetClass accelWidget) => ReadWriteAttr self (Maybe Widget) accelWidget

# Detail

The `AccelLabel` widget is a subclass of `Label` that also displays an accelerator key on the right of the label text, e.g. 'Ctl+S'. It is commonly used in menus to show the keyboard short-cuts for commands.

The accelerator key to display is not set explicitly. Instead, the `AccelLabel` displays the accelerators which have been added to a particular widget. This widget is set by calling `accelLabelSetAccelWidget`.

For example, a `MenuItem` widget may have an accelerator added to emit the "activate" signal when the 'Ctl+S' key combination is pressed. A `AccelLabel` is created and added to the `MenuItem`, and `accelLabelSetAccelWidget` is called with the `MenuItem` as the second argument. The `AccelLabel` will now display 'Ctl+S' after its label.

Note that creating a `MenuItem` with `menuItemNewWithLabel` (or one of the similar functions for `CheckMenuItem` and `RadioMenuItem`) automatically adds a `AccelLabel` to the `MenuItem` and calls `accelLabelSetAccelWidget` to set it up for you.

An `AccelLabel` will only display accelerators which have `AccelVisible` set (see `AccelFlags`). A `AccelLabel` can display multiple accelerators and even signal names, though it is almost always used to display just one accelerator key.

# Class Hierarchy

    | GObject
    | +----Object
    | +----Widget
    | +----Misc
    | +----Label
    | +----AccelLabel

# Types

data AccelLabel Source #

#### Instances

Instances details

Eq AccelLabel Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: AccelLabel -> AccelLabel -> Bool Source # (/=) :: AccelLabel -> AccelLabel -> Bool Source #
Ord AccelLabel Source # |

Instance details

Defined in Graphics.UI.Gtk.Types

Methods

compare :: AccelLabel -> AccelLabel -> Ordering Source #

(<) :: AccelLabel -> AccelLabel -> Bool Source #

(<=) :: AccelLabel -> AccelLabel -> Bool Source #

(>) :: AccelLabel -> AccelLabel -> Bool Source #

(>=) :: AccelLabel -> AccelLabel -> Bool Source #

max :: AccelLabel -> AccelLabel -> AccelLabel Source #

min :: AccelLabel -> AccelLabel -> AccelLabel Source #

GObjectClass AccelLabel Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: AccelLabel -> GObject Source # unsafeCastGObject :: GObject -> AccelLabel Source #
AccelLabelClass AccelLabel Source # |
Instance details Defined in Graphics.UI.Gtk.Types
LabelClass AccelLabel Source # |
Instance details Defined in Graphics.UI.Gtk.Types
MiscClass AccelLabel Source # |
Instance details Defined in Graphics.UI.Gtk.Types
WidgetClass AccelLabel Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class LabelClass o => AccelLabelClass o Source #

#### Instances

Instances details

AccelLabelClass AccelLabel Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToAccelLabel :: GObjectClass obj => obj -> AccelLabel Source #

gTypeAccelLabel :: GType Source #

toAccelLabel :: AccelLabelClass o => o -> AccelLabel Source #

# Constructors

accelLabelNew Source #

Arguments

:: GlibString string |
=> string | `string` - the label string.
-> IO AccelLabel |

Creates a new `AccelLabel`.

# Methods

accelLabelSetAccelWidget Source #

Arguments

:: (AccelLabelClass self, WidgetClass accelWidget) |
=> self |
-> accelWidget | `accelWidget` - the widget to be monitored.
-> IO () |

Sets the widget to be monitored by this accelerator label.

accelLabelGetAccelWidget Source #

Arguments

:: AccelLabelClass self |
=> self |
-> IO (Maybe Widget) | returns the object monitored by the accelerator label, or `Nothing`.

Fetches the widget monitored by this accelerator label. See `accelLabelSetAccelWidget`.

# Attributes

accelLabelAccelWidget :: (AccelLabelClass self, WidgetClass accelWidget) => ReadWriteAttr self (Maybe Widget) accelWidget Source #

The widget to be monitored for accelerator changes.