gi-gtk-3.0.32: 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

Contents

Description

GtkToolButtons are GtkToolItems containing buttons.

Use toolButtonNew to create a new tToolButton.

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

newtype ToolButton Source #

Memory-managed wrapper type.

Constructors

ToolButton (ManagedPtr ToolButton) 
Instances
Eq ToolButton Source # 
Instance details

Defined in GI.Gtk.Objects.ToolButton

Methods

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

(/=) :: ToolButton -> ToolButton -> Bool

GObject ToolButton Source # 
Instance details

Defined in GI.Gtk.Objects.ToolButton

Methods

gobjectType :: IO GType

IsGValue ToolButton Source #

Convert ToolButton to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.ToolButton

Methods

toGValue :: ToolButton -> IO GValue

fromGValue :: GValue -> IO ToolButton

HasParentTypes ToolButton Source # 
Instance details

Defined in GI.Gtk.Objects.ToolButton

type ParentTypes ToolButton Source # 
Instance details

Defined in GI.Gtk.Objects.ToolButton

type ParentTypes ToolButton = ToolItem ': (Bin ': (Container ': (Widget ': (Object ': (ImplementorIface ': (Actionable ': (Activatable ': (Buildable ': ([] :: [Type])))))))))

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

noToolButton :: Maybe ToolButton Source #

A convenience alias for Nothing :: Maybe ToolButton.

Methods

Overloaded methods

getIconName

toolButtonGetIconName Source #

Arguments

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

button: a tToolButton

-> 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 tToolButton

-> 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 tToolButton

-> 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 tToolButton

-> 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 tToolButton

-> 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 tToolButton

-> 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 tToolButton

Creates a new tToolButton 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 tToolButton

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

Creates a new tToolButton 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 tToolButton

-> 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 tIconTheme for more details. The tToolButton:icon-name property only has an effect if not overridden by non-Nothing tToolButton:label-widget, tToolButton:icon-widget and tToolButton:stock-id properties.

Since: 2.8

setIconWidget

toolButtonSetIconWidget Source #

Arguments

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

button: a tToolButton

-> 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 tToolButton:stock-id property. If the tToolButton: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 tToolButton

-> 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 tToolButton:label property only has an effect if not overridden by a non-Nothing tToolButton:label-widget property. If both the tToolButton:label-widget and tToolButton:label properties are Nothing, the label is determined by the tToolButton:stock-id property. If the tToolButton: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 tToolButton

-> 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 tToolButton:label property is used as label. If tToolButton:label is also Nothing, the label in the stock item determined by the tToolButton:stock-id property is used as label. If tToolButton: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 tToolButton

-> 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 tToolButton:label-widget and tToolButton:icon-widget properties.

Since: 2.4

setUseUnderline

toolButtonSetUseUnderline Source #

Arguments

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

button: a tToolButton

-> 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 tToolButton:label-widget, tToolButton:icon-widget or tToolButton: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 => Text -> IO (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, IsWidget a) => a -> IO (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 => Text -> IO (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, IsWidget a) => a -> IO (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 => Text -> IO (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 => Bool -> IO (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

genClosure_ToolButtonClicked :: MonadIO m => ToolButtonClickedCallback -> m (GClosure C_ToolButtonClickedCallback) Source #

Wrap the callback into a GClosure.

mk_ToolButtonClickedCallback :: C_ToolButtonClickedCallback -> IO (FunPtr C_ToolButtonClickedCallback) Source #

Generate a function pointer callable from C code, from a C_ToolButtonClickedCallback.

noToolButtonClickedCallback :: Maybe ToolButtonClickedCallback Source #

A convenience synonym for Nothing :: Maybe ToolButtonClickedCallback.

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