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.MenuComboToolbar.ToolButton

Contents

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

Description

A `ToolItem` subclass that displays buttons

- Module available since Gtk+ version 2.4

Synopsis

- data ToolButton
- class ToolItemClass o => ToolButtonClass o
- castToToolButton :: GObjectClass obj => obj -> ToolButton
- gTypeToolButton :: GType
- toToolButton :: ToolButtonClass o => o -> ToolButton
- toolButtonNew :: (WidgetClass iconWidget, GlibString string) => Maybe iconWidget -> Maybe string -> IO ToolButton
- toolButtonNewFromStock :: StockId -> IO ToolButton
- toolButtonSetLabel :: (ToolButtonClass self, GlibString string) => self -> Maybe string -> IO ()
- toolButtonGetLabel :: (ToolButtonClass self, GlibString string) => self -> IO (Maybe string)
- toolButtonSetUseUnderline :: ToolButtonClass self => self -> Bool -> IO ()
- toolButtonGetUseUnderline :: ToolButtonClass self => self -> IO Bool
- toolButtonSetStockId :: ToolButtonClass self => self -> Maybe StockId -> IO ()
- toolButtonGetStockId :: ToolButtonClass self => self -> IO (Maybe StockId)
- toolButtonSetIconWidget :: (ToolButtonClass self, WidgetClass iconWidget) => self -> Maybe iconWidget -> IO ()
- toolButtonGetIconWidget :: ToolButtonClass self => self -> IO (Maybe Widget)
- toolButtonSetLabelWidget :: (ToolButtonClass self, WidgetClass labelWidget) => self -> Maybe labelWidget -> IO ()
- toolButtonGetLabelWidget :: ToolButtonClass self => self -> IO (Maybe Widget)
- toolButtonSetIconName :: (ToolButtonClass self, GlibString string) => self -> string -> IO ()
- toolButtonGetIconName :: (ToolButtonClass self, GlibString string) => self -> IO string
- toolButtonLabel :: (ToolButtonClass self, GlibString string) => Attr self (Maybe string)
- toolButtonUseUnderline :: ToolButtonClass self => Attr self Bool
- toolButtonLabelWidget :: (ToolButtonClass self, WidgetClass labelWidget) => ReadWriteAttr self (Maybe Widget) (Maybe labelWidget)
- toolButtonStockId :: ToolButtonClass self => ReadWriteAttr self (Maybe StockId) (Maybe StockId)
- toolButtonIconName :: (ToolButtonClass self, GlibString string) => Attr self string
- toolButtonIconWidget :: (ToolButtonClass self, WidgetClass iconWidget) => ReadWriteAttr self (Maybe Widget) (Maybe iconWidget)
- onToolButtonClicked :: ToolButtonClass self => self -> IO () -> IO (ConnectId self)
- afterToolButtonClicked :: ToolButtonClass self => self -> IO () -> IO (ConnectId self)

# Detail

`ToolButton`s are `ToolItems` containing buttons.

Use `toolButtonNew` to create a new `ToolButton`. Use `toolButtonNewWithStock` to create a `ToolButton` containing a stock item.

The label of a `ToolButton` is determined by the properties "label_widget", "label", and "stock_id". If "label_widget" is not `Nothing`, then that widget is used as the label. Otherwise, if "label" is not `Nothing`, that string is used as the label. Otherwise, if "stock_id" is not `Nothing`, the label is determined by the stock item. Otherwise, the button does not have a label.

The icon of a `ToolButton` is determined by the properties "icon_widget" and "stock_id". If "icon_widget" is not `Nothing`, then that widget is used as the icon. Otherwise, if "stock_id" is not `Nothing`, the icon is determined by the stock item. Otherwise, the button does not have a label.

# Class Hierarchy

    | GObject
    | +----Object
    | +----Widget
    | +----Container
    | +----Bin
    | +----ToolItem
    | +----ToolButton
    | +----MenuToolButton
    | +----ToggleToolButton

# Types

data ToolButton Source #

#### Instances

Instances details

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

Instance details

Defined in Graphics.UI.Gtk.Types

Methods

compare :: ToolButton -> ToolButton -> Ordering Source #

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

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

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

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

max :: ToolButton -> ToolButton -> ToolButton Source #

min :: ToolButton -> ToolButton -> ToolButton Source #

GObjectClass ToolButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: ToolButton -> GObject Source # unsafeCastGObject :: GObject -> ToolButton Source #
BinClass ToolButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ContainerClass ToolButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ToolButtonClass ToolButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ToolItemClass ToolButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types
WidgetClass ToolButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class ToolItemClass o => ToolButtonClass o Source #

#### Instances

Instances details

ToolButtonClass MenuToolButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ToolButtonClass RadioToolButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ToolButtonClass ToggleToolButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ToolButtonClass ToolButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToToolButton :: GObjectClass obj => obj -> ToolButton Source #

gTypeToolButton :: GType Source #

toToolButton :: ToolButtonClass o => o -> ToolButton Source #

# Constructors

toolButtonNew Source #

Arguments

:: (WidgetClass iconWidget, GlibString string) |
=> Maybe iconWidget | `iconWidget` - a widget that will be used as icon widget, or `Nothing`
-> Maybe string | `label` - a string that will be used as label, or `Nothing`
-> IO ToolButton |

Creates a new `ToolButton` using `iconWidget` as icon and `label` as label.

toolButtonNewFromStock Source #

Arguments

:: StockId | `stockId` - the name of the stock item
-> IO ToolButton |

Creates a new `ToolButton` containing the image and text from a stock item.

It is an error if `stockId` is not a name of a stock item.

# Methods

toolButtonSetLabel Source #

Arguments

:: (ToolButtonClass self, GlibString string) |
=> self |
-> Maybe string | `label` - a string that will be used as label, or `Nothing`.
-> IO () |

Sets `label` as the label used for the tool button. The "label" property only has an effect if not overridden by a non-`Nothing` "label_widget" property. If both the "label_widget" and "label" properties are `Nothing`, the label is determined by the "stock_id" property. If the "stock_id" property is also `Nothing`, `button` will not have a label.

toolButtonGetLabel :: (ToolButtonClass self, GlibString string) => self -> IO (Maybe string) Source #

Returns the label used by the tool button, or `Nothing` if the tool button doesn't have a label. or uses a the label from a stock item.

toolButtonSetUseUnderline :: ToolButtonClass self => self -> Bool -> IO () Source #

If set, an underline in the label property indicates that the next character should be used for the mnemonic accelerator key in the overflow menu. For example, if the label property is "_Open" and `useUnderline` is `True`, the label on the tool button will be "Open" and the item on the overflow menu will have an underlined 'O'.

Labels shown on tool buttons never have mnemonics on them; this property only affects the menu item on the overflow menu.

toolButtonGetUseUnderline :: ToolButtonClass self => self -> IO Bool Source #

Returns whether underscores in the label property are used as mnemonics on menu items on the overflow menu. See `toolButtonSetUseUnderline`.

toolButtonSetStockId Source #

Arguments

:: ToolButtonClass self |
=> self |
-> Maybe StockId | `stockId` - a name of a stock item, or `Nothing`
-> IO () |

Sets the name of the stock item. See `toolButtonNewFromStock`. The stock_id property only has an effect if not overridden by non-`Nothing` "label" and "icon_widget" properties.

toolButtonGetStockId :: ToolButtonClass self => self -> IO (Maybe StockId) Source #

Returns the name of the stock item. See `toolButtonSetStockId`.

toolButtonSetIconWidget Source #

Arguments

:: (ToolButtonClass self, WidgetClass iconWidget) |
=> self |
-> Maybe iconWidget | `iconWidget` - the widget used as icon, or `Nothing`
-> IO () |

Sets `icon` as the widget used as icon on `button`. If `iconWidget` is `Nothing` the icon is determined by the "stock_id" property. If the "stock_id" property is also `Nothing`, the button will not have an icon.

toolButtonGetIconWidget Source #

Arguments

:: ToolButtonClass self |
=> self |
-> IO (Maybe Widget) | returns The widget used as icon on `button`, or `Nothing`.

Return the widget used as icon widget on `button`. See `toolButtonSetIconWidget`.

toolButtonSetLabelWidget Source #

Arguments

:: (ToolButtonClass self, WidgetClass labelWidget) |
=> self |
-> Maybe labelWidget | `labelWidget` - the widget used as label, or `Nothing`
-> IO () |

Sets `labelWidget` as the widget that will be used as the label for `button`. If `labelWidget` is `Nothing` the "label" property is used as label. If "label" is also `Nothing`, the label in the stock item determined by the "stock_id" property is used as label. If "stock_id" is also `Nothing`, `button` does not have a label.

toolButtonGetLabelWidget Source #

Arguments

:: ToolButtonClass self |
=> self |
-> IO (Maybe Widget) | returns The widget used as label on `button`, or `Nothing`.

Returns the widget used as label on `button`. See `toolButtonSetLabelWidget`.

toolButtonSetIconName Source #

Arguments

:: (ToolButtonClass self, GlibString string) |
=> self |
-> string | `iconName` - the name of the themed icon
-> IO () |

Sets the icon for the tool button from a named themed icon. See the docs for `IconTheme` for more details. The "icon_name" property only has an effect if not overridden by the "label", "icon_widget" and "stock_id" properties.

- Available since Gtk+ version 2.8

toolButtonGetIconName Source #

Arguments

:: (ToolButtonClass self, GlibString string) |
=> self |
-> IO string | returns the icon name or `""` if the tool button has no themed icon.

Returns the name of the themed icon for the tool button, see `toolButtonSetIconName`.

- Available since Gtk+ version 2.8

# Attributes

toolButtonLabel :: (ToolButtonClass self, GlibString string) => Attr self (Maybe string) Source #

Text to show in the item.

Default value: `Nothing`

toolButtonUseUnderline :: ToolButtonClass self => Attr self Bool Source #

If set, an underline in the label property indicates that the next character should be used for the mnemonic accelerator key in the overflow menu.

Default value: `False`

toolButtonLabelWidget :: (ToolButtonClass self, WidgetClass labelWidget) => ReadWriteAttr self (Maybe Widget) (Maybe labelWidget) Source #

Widget to use as the item label.

toolButtonStockId :: ToolButtonClass self => ReadWriteAttr self (Maybe StockId) (Maybe StockId) Source #

The stock icon displayed on the item.

Default value: `Nothing`

toolButtonIconName :: (ToolButtonClass self, GlibString string) => Attr self string Source #

The name of the themed icon displayed on the item. This property only has an effect if not overridden by "label", "icon_widget" or "stock_id" properties.

Default value: ""

toolButtonIconWidget :: (ToolButtonClass self, WidgetClass iconWidget) => ReadWriteAttr self (Maybe Widget) (Maybe iconWidget) Source #

Icon widget to display in the item.

# Signals

onToolButtonClicked :: ToolButtonClass self => self -> IO () -> IO (ConnectId self) Source #

This signal is emitted when the tool button is clicked with the mouse or activated with the keyboard.

afterToolButtonClicked :: ToolButtonClass self => self -> IO () -> IO (ConnectId self) Source #

This signal is emitted when the tool button is clicked with the mouse or activated with the keyboard.