gi-gtk-3.0.36: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.ToolButton

Description

GtkToolButtons are GtkToolItems containing buttons.

Use toolButtonNew to create a new ToolButton.

The label of a ToolButton is determined by the properties ToolButton:label-widget, ToolButton:label, and ToolButton:stock-id. If ToolButton:label-widget is non-Nothing, then that widget is used as the label. Otherwise, if ToolButton:label is non-Nothing, that string is used as the label. Otherwise, if ToolButton:stock-id is non-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 ToolButton:icon-widget and ToolButton:stock-id. If ToolButton:icon-widget is non-Nothing, then that widget is used as the icon. Otherwise, if ToolButton:stock-id is non-Nothing, the icon is determined by the stock item. Otherwise, the button does not have a icon.

CSS nodes

GtkToolButton has a single CSS node with name toolbutton.

Synopsis

Exported types

class (GObject o, IsDescendantOf ToolButton o) => IsToolButton o Source #

Type class for types which can be safely cast to ToolButton, for instance with toToolButton.

Instances

Instances details
(GObject o, IsDescendantOf ToolButton o) => IsToolButton o Source # 
Instance details

Defined in GI.Gtk.Objects.ToolButton

toToolButton :: (MonadIO m, IsToolButton o) => o -> m ToolButton Source #

Cast to ToolButton, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

getIconName

toolButtonGetIconName Source #

Arguments

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

button: a ToolButton

-> m (Maybe Text)

Returns: the icon name or Nothing if the tool button has no themed icon

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

Since: 2.8

getIconWidget

toolButtonGetIconWidget Source #

Arguments

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

button: a ToolButton

-> m (Maybe Widget)

Returns: The widget used as icon on button, or Nothing.

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

Since: 2.4

getLabel

toolButtonGetLabel Source #

Arguments

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

button: a ToolButton

-> m (Maybe Text)

Returns: The label, or Nothing

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. The returned string is owned by GTK+, and must not be modified or freed.

Since: 2.4

getLabelWidget

toolButtonGetLabelWidget Source #

Arguments

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

button: a ToolButton

-> m (Maybe Widget)

Returns: The widget used as label on button, or Nothing.

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

Since: 2.4

getStockId

toolButtonGetStockId Source #

Arguments

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

button: a ToolButton

-> m Text

Returns: the name of the stock item for button.

Deprecated: (Since version 3.10)Use toolButtonGetIconName instead.

Returns the name of the stock item. See toolButtonSetStockId. The returned string is owned by GTK+ and must not be freed or modifed.

Since: 2.4

getUseUnderline

toolButtonGetUseUnderline Source #

Arguments

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

button: a ToolButton

-> m Bool

Returns: True if underscores in the label property are used as mnemonics on menu items on the overflow menu.

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

Since: 2.4

new

toolButtonNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a) 
=> Maybe a

iconWidget: a widget that will be used as the button contents, or Nothing

-> Maybe Text

label: a string that will be used as label, or Nothing

-> m ToolButton

Returns: A new ToolButton

Creates a new ToolButton using iconWidget as contents and label as label.

Since: 2.4

newFromStock

toolButtonNewFromStock Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

stockId: the name of the stock item

-> m ToolButton

Returns: A new ToolButton

Deprecated: (Since version 3.10)Use toolButtonNew together withimageNewFromIconName instead.

Creates a new ToolButton containing the image and text from a stock item. Some stock ids have preprocessor macros like STOCK_OK and STOCK_APPLY.

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

Since: 2.4

setIconName

toolButtonSetIconName Source #

Arguments

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

button: a ToolButton

-> Maybe Text

iconName: the name of the themed icon

-> m () 

Sets the icon for the tool button from a named themed icon. See the docs for IconTheme for more details. The ToolButton:icon-name property only has an effect if not overridden by non-Nothing ToolButton:label-widget, ToolButton:icon-widget and ToolButton:stock-id properties.

Since: 2.8

setIconWidget

toolButtonSetIconWidget Source #

Arguments

:: (HasCallStack, MonadIO m, IsToolButton a, IsWidget b) 
=> a

button: a ToolButton

-> Maybe b

iconWidget: the widget used as icon, or Nothing

-> m () 

Sets icon as the widget used as icon on button. If iconWidget is Nothing the icon is determined by the ToolButton:stock-id property. If the ToolButton:stock-id property is also Nothing, button will not have an icon.

Since: 2.4

setLabel

toolButtonSetLabel Source #

Arguments

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

button: a ToolButton

-> Maybe Text

label: a string that will be used as label, or Nothing.

-> m () 

Sets label as the label used for the tool button. The ToolButton:label property only has an effect if not overridden by a non-Nothing ToolButton:label-widget property. If both the ToolButton:label-widget and ToolButton:label properties are Nothing, the label is determined by the ToolButton:stock-id property. If the ToolButton:stock-id property is also Nothing, button will not have a label.

Since: 2.4

setLabelWidget

toolButtonSetLabelWidget Source #

Arguments

:: (HasCallStack, MonadIO m, IsToolButton a, IsWidget b) 
=> a

button: a ToolButton

-> Maybe b

labelWidget: the widget used as label, or Nothing

-> m () 

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

Since: 2.4

setStockId

toolButtonSetStockId Source #

Arguments

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

button: a ToolButton

-> Maybe Text

stockId: a name of a stock item, or Nothing

-> m () 

Deprecated: (Since version 3.10)Use toolButtonSetIconName instead.

Sets the name of the stock item. See toolButtonNewFromStock. The stock_id property only has an effect if not overridden by non-Nothing ToolButton:label-widget and ToolButton:icon-widget properties.

Since: 2.4

setUseUnderline

toolButtonSetUseUnderline Source #

Arguments

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

button: a ToolButton

-> Bool

useUnderline: whether the button label has the form “_Open”

-> m () 

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.

Since: 2.4

Properties

iconName

The name of the themed icon displayed on the item. This property only has an effect if not overridden by ToolButton:label-widget, ToolButton:icon-widget or ToolButton:stock-id properties.

Since: 2.8

clearToolButtonIconName :: (MonadIO m, IsToolButton o) => o -> m () Source #

Set the value of the “icon-name” property to Nothing. When overloading is enabled, this is equivalent to

clear #iconName

constructToolButtonIconName :: (IsToolButton o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “icon-name” property. This is rarely needed directly, but it is used by new.

getToolButtonIconName :: (MonadIO m, IsToolButton o) => o -> m (Maybe Text) Source #

Get the value of the “icon-name” property. When overloading is enabled, this is equivalent to

get toolButton #iconName

setToolButtonIconName :: (MonadIO m, IsToolButton o) => o -> Text -> m () Source #

Set the value of the “icon-name” property. When overloading is enabled, this is equivalent to

set toolButton [ #iconName := value ]

iconWidget

No description available in the introspection data.

clearToolButtonIconWidget :: (MonadIO m, IsToolButton o) => o -> m () Source #

Set the value of the “icon-widget” property to Nothing. When overloading is enabled, this is equivalent to

clear #iconWidget

constructToolButtonIconWidget :: (IsToolButton o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “icon-widget” property. This is rarely needed directly, but it is used by new.

getToolButtonIconWidget :: (MonadIO m, IsToolButton o) => o -> m (Maybe Widget) Source #

Get the value of the “icon-widget” property. When overloading is enabled, this is equivalent to

get toolButton #iconWidget

setToolButtonIconWidget :: (MonadIO m, IsToolButton o, IsWidget a) => o -> a -> m () Source #

Set the value of the “icon-widget” property. When overloading is enabled, this is equivalent to

set toolButton [ #iconWidget := value ]

label

No description available in the introspection data.

clearToolButtonLabel :: (MonadIO m, IsToolButton o) => o -> m () Source #

Set the value of the “label” property to Nothing. When overloading is enabled, this is equivalent to

clear #label

constructToolButtonLabel :: (IsToolButton o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “label” property. This is rarely needed directly, but it is used by new.

getToolButtonLabel :: (MonadIO m, IsToolButton o) => o -> m (Maybe Text) Source #

Get the value of the “label” property. When overloading is enabled, this is equivalent to

get toolButton #label

setToolButtonLabel :: (MonadIO m, IsToolButton o) => o -> Text -> m () Source #

Set the value of the “label” property. When overloading is enabled, this is equivalent to

set toolButton [ #label := value ]

labelWidget

No description available in the introspection data.

clearToolButtonLabelWidget :: (MonadIO m, IsToolButton o) => o -> m () Source #

Set the value of the “label-widget” property to Nothing. When overloading is enabled, this is equivalent to

clear #labelWidget

constructToolButtonLabelWidget :: (IsToolButton o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “label-widget” property. This is rarely needed directly, but it is used by new.

getToolButtonLabelWidget :: (MonadIO m, IsToolButton o) => o -> m (Maybe Widget) Source #

Get the value of the “label-widget” property. When overloading is enabled, this is equivalent to

get toolButton #labelWidget

setToolButtonLabelWidget :: (MonadIO m, IsToolButton o, IsWidget a) => o -> a -> m () Source #

Set the value of the “label-widget” property. When overloading is enabled, this is equivalent to

set toolButton [ #labelWidget := value ]

stockId

No description available in the introspection data.

clearToolButtonStockId :: (MonadIO m, IsToolButton o) => o -> m () Source #

Set the value of the “stock-id” property to Nothing. When overloading is enabled, this is equivalent to

clear #stockId

constructToolButtonStockId :: (IsToolButton o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “stock-id” property. This is rarely needed directly, but it is used by new.

getToolButtonStockId :: (MonadIO m, IsToolButton o) => o -> m Text Source #

Get the value of the “stock-id” property. When overloading is enabled, this is equivalent to

get toolButton #stockId

setToolButtonStockId :: (MonadIO m, IsToolButton o) => o -> Text -> m () Source #

Set the value of the “stock-id” property. When overloading is enabled, this is equivalent to

set toolButton [ #stockId := value ]

useUnderline

No description available in the introspection data.

constructToolButtonUseUnderline :: (IsToolButton o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “use-underline” property. This is rarely needed directly, but it is used by new.

getToolButtonUseUnderline :: (MonadIO m, IsToolButton o) => o -> m Bool Source #

Get the value of the “use-underline” property. When overloading is enabled, this is equivalent to

get toolButton #useUnderline

setToolButtonUseUnderline :: (MonadIO m, IsToolButton o) => o -> Bool -> m () Source #

Set the value of the “use-underline” property. When overloading is enabled, this is equivalent to

set toolButton [ #useUnderline := value ]

Signals

clicked

type C_ToolButtonClickedCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type ToolButtonClickedCallback = IO () Source #

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

afterToolButtonClicked :: (IsToolButton a, MonadIO m) => a -> ToolButtonClickedCallback -> m SignalHandlerId Source #

Connect a signal handler for the clicked signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after toolButton #clicked callback

onToolButtonClicked :: (IsToolButton a, MonadIO m) => a -> ToolButtonClickedCallback -> m SignalHandlerId Source #

Connect a signal handler for the clicked signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on toolButton #clicked callback