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

Contents

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

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

data ToolButtonIconNamePropertyInfo Source #

Instances

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

iconWidget

data ToolButtonIconWidgetPropertyInfo Source #

Instances

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

label

data ToolButtonLabelPropertyInfo Source #

Instances

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

labelWidget

data ToolButtonLabelWidgetPropertyInfo Source #

Instances

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

stockId

data ToolButtonStockIdPropertyInfo Source #

Instances

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

useUnderline

data ToolButtonUseUnderlinePropertyInfo Source #

Instances

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

Signals

clicked