Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
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.
- newtype ToolButton = ToolButton (ManagedPtr ToolButton)
- class GObject o => IsToolButton o
- toToolButton :: IsToolButton o => o -> IO ToolButton
- noToolButton :: Maybe ToolButton
- data ToolButtonGetIconNameMethodInfo
- toolButtonGetIconName :: (HasCallStack, MonadIO m, IsToolButton a) => a -> m (Maybe Text)
- data ToolButtonGetIconWidgetMethodInfo
- toolButtonGetIconWidget :: (HasCallStack, MonadIO m, IsToolButton a) => a -> m (Maybe Widget)
- data ToolButtonGetLabelMethodInfo
- toolButtonGetLabel :: (HasCallStack, MonadIO m, IsToolButton a) => a -> m (Maybe Text)
- data ToolButtonGetLabelWidgetMethodInfo
- toolButtonGetLabelWidget :: (HasCallStack, MonadIO m, IsToolButton a) => a -> m (Maybe Widget)
- data ToolButtonGetStockIdMethodInfo
- toolButtonGetStockId :: (HasCallStack, MonadIO m, IsToolButton a) => a -> m Text
- data ToolButtonGetUseUnderlineMethodInfo
- toolButtonGetUseUnderline :: (HasCallStack, MonadIO m, IsToolButton a) => a -> m Bool
- toolButtonNew :: (HasCallStack, MonadIO m, IsWidget a) => Maybe a -> Maybe Text -> m ToolButton
- toolButtonNewFromStock :: (HasCallStack, MonadIO m) => Text -> m ToolButton
- data ToolButtonSetIconNameMethodInfo
- toolButtonSetIconName :: (HasCallStack, MonadIO m, IsToolButton a) => a -> Maybe Text -> m ()
- data ToolButtonSetIconWidgetMethodInfo
- toolButtonSetIconWidget :: (HasCallStack, MonadIO m, IsToolButton a, IsWidget b) => a -> Maybe b -> m ()
- data ToolButtonSetLabelMethodInfo
- toolButtonSetLabel :: (HasCallStack, MonadIO m, IsToolButton a) => a -> Maybe Text -> m ()
- data ToolButtonSetLabelWidgetMethodInfo
- toolButtonSetLabelWidget :: (HasCallStack, MonadIO m, IsToolButton a, IsWidget b) => a -> Maybe b -> m ()
- data ToolButtonSetStockIdMethodInfo
- toolButtonSetStockId :: (HasCallStack, MonadIO m, IsToolButton a) => a -> Maybe Text -> m ()
- data ToolButtonSetUseUnderlineMethodInfo
- toolButtonSetUseUnderline :: (HasCallStack, MonadIO m, IsToolButton a) => a -> Bool -> m ()
- data ToolButtonIconNamePropertyInfo
- clearToolButtonIconName :: (MonadIO m, IsToolButton o) => o -> m ()
- constructToolButtonIconName :: IsToolButton o => Text -> IO (GValueConstruct o)
- getToolButtonIconName :: (MonadIO m, IsToolButton o) => o -> m (Maybe Text)
- setToolButtonIconName :: (MonadIO m, IsToolButton o) => o -> Text -> m ()
- toolButtonIconName :: AttrLabelProxy "iconName"
- data ToolButtonIconWidgetPropertyInfo
- clearToolButtonIconWidget :: (MonadIO m, IsToolButton o) => o -> m ()
- constructToolButtonIconWidget :: (IsToolButton o, IsWidget a) => a -> IO (GValueConstruct o)
- getToolButtonIconWidget :: (MonadIO m, IsToolButton o) => o -> m (Maybe Widget)
- setToolButtonIconWidget :: (MonadIO m, IsToolButton o, IsWidget a) => o -> a -> m ()
- toolButtonIconWidget :: AttrLabelProxy "iconWidget"
- data ToolButtonLabelPropertyInfo
- clearToolButtonLabel :: (MonadIO m, IsToolButton o) => o -> m ()
- constructToolButtonLabel :: IsToolButton o => Text -> IO (GValueConstruct o)
- getToolButtonLabel :: (MonadIO m, IsToolButton o) => o -> m (Maybe Text)
- setToolButtonLabel :: (MonadIO m, IsToolButton o) => o -> Text -> m ()
- toolButtonLabel :: AttrLabelProxy "label"
- data ToolButtonLabelWidgetPropertyInfo
- clearToolButtonLabelWidget :: (MonadIO m, IsToolButton o) => o -> m ()
- constructToolButtonLabelWidget :: (IsToolButton o, IsWidget a) => a -> IO (GValueConstruct o)
- getToolButtonLabelWidget :: (MonadIO m, IsToolButton o) => o -> m (Maybe Widget)
- setToolButtonLabelWidget :: (MonadIO m, IsToolButton o, IsWidget a) => o -> a -> m ()
- toolButtonLabelWidget :: AttrLabelProxy "labelWidget"
- data ToolButtonStockIdPropertyInfo
- clearToolButtonStockId :: (MonadIO m, IsToolButton o) => o -> m ()
- constructToolButtonStockId :: IsToolButton o => Text -> IO (GValueConstruct o)
- getToolButtonStockId :: (MonadIO m, IsToolButton o) => o -> m Text
- setToolButtonStockId :: (MonadIO m, IsToolButton o) => o -> Text -> m ()
- toolButtonStockId :: AttrLabelProxy "stockId"
- data ToolButtonUseUnderlinePropertyInfo
- constructToolButtonUseUnderline :: IsToolButton o => Bool -> IO (GValueConstruct o)
- getToolButtonUseUnderline :: (MonadIO m, IsToolButton o) => o -> m Bool
- setToolButtonUseUnderline :: (MonadIO m, IsToolButton o) => o -> Bool -> m ()
- toolButtonUseUnderline :: AttrLabelProxy "useUnderline"
- type C_ToolButtonClickedCallback = Ptr () -> Ptr () -> IO ()
- type ToolButtonClickedCallback = IO ()
- data ToolButtonClickedSignalInfo
- afterToolButtonClicked :: (GObject a, MonadIO m) => a -> ToolButtonClickedCallback -> m SignalHandlerId
- genClosure_ToolButtonClicked :: ToolButtonClickedCallback -> IO Closure
- mk_ToolButtonClickedCallback :: C_ToolButtonClickedCallback -> IO (FunPtr C_ToolButtonClickedCallback)
- noToolButtonClickedCallback :: Maybe ToolButtonClickedCallback
- onToolButtonClicked :: (GObject a, MonadIO m) => a -> ToolButtonClickedCallback -> m SignalHandlerId
- wrap_ToolButtonClickedCallback :: ToolButtonClickedCallback -> Ptr () -> Ptr () -> IO ()
Exported types
newtype ToolButton Source #
GObject ToolButton Source # | |
IsImplementorIface ToolButton Source # | |
IsObject ToolButton Source # | |
IsWidget ToolButton Source # | |
IsToolItem ToolButton Source # | |
IsToolButton ToolButton Source # | |
IsContainer ToolButton Source # | |
IsBin ToolButton Source # | |
IsBuildable ToolButton Source # | |
IsActivatable ToolButton Source # | |
IsActionable ToolButton Source # | |
((~) * info (ResolveToolButtonMethod t ToolButton), MethodInfo * info ToolButton p) => IsLabel t (ToolButton -> p) Source # | |
((~) * info (ResolveToolButtonMethod t ToolButton), MethodInfo * info ToolButton p) => IsLabelProxy t (ToolButton -> p) Source # | |
HasAttributeList * ToolButton Source # | |
type AttributeList ToolButton Source # | |
type SignalList ToolButton Source # | |
class GObject o => IsToolButton o Source #
toToolButton :: IsToolButton o => o -> IO ToolButton Source #
Methods
getIconName
data ToolButtonGetIconNameMethodInfo Source #
((~) * signature (m (Maybe Text)), MonadIO m, IsToolButton a) => MethodInfo * ToolButtonGetIconNameMethodInfo a signature Source # | |
toolButtonGetIconName Source #
:: (HasCallStack, MonadIO m, IsToolButton a) | |
=> a |
|
-> m (Maybe Text) | Returns: the icon name or |
Returns the name of the themed icon for the tool button,
see toolButtonSetIconName
.
Since: 2.8
getIconWidget
data ToolButtonGetIconWidgetMethodInfo Source #
((~) * signature (m (Maybe Widget)), MonadIO m, IsToolButton a) => MethodInfo * ToolButtonGetIconWidgetMethodInfo a signature Source # | |
toolButtonGetIconWidget Source #
:: (HasCallStack, MonadIO m, IsToolButton a) | |
=> a |
|
-> m (Maybe Widget) | Returns: The widget used as icon
on |
Return the widget used as icon widget on button
.
See toolButtonSetIconWidget
.
Since: 2.4
getLabel
data ToolButtonGetLabelMethodInfo Source #
((~) * signature (m (Maybe Text)), MonadIO m, IsToolButton a) => MethodInfo * ToolButtonGetLabelMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsToolButton a) | |
=> a |
|
-> m (Maybe Text) | Returns: The label, or |
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
data ToolButtonGetLabelWidgetMethodInfo Source #
((~) * signature (m (Maybe Widget)), MonadIO m, IsToolButton a) => MethodInfo * ToolButtonGetLabelWidgetMethodInfo a signature Source # | |
toolButtonGetLabelWidget Source #
:: (HasCallStack, MonadIO m, IsToolButton a) | |
=> a |
|
-> m (Maybe Widget) | Returns: The widget used as label
on |
Returns the widget used as label on button
.
See toolButtonSetLabelWidget
.
Since: 2.4
getStockId
data ToolButtonGetStockIdMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsToolButton a) => MethodInfo * ToolButtonGetStockIdMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsToolButton a) | |
=> a |
|
-> m Text | Returns: the name of the stock item for |
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
data ToolButtonGetUseUnderlineMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsToolButton a) => MethodInfo * ToolButtonGetUseUnderlineMethodInfo a signature Source # | |
toolButtonGetUseUnderline Source #
:: (HasCallStack, MonadIO m, IsToolButton a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether underscores in the label property are used as mnemonics
on menu items on the overflow menu. See toolButtonSetUseUnderline
.
Since: 2.4
new
:: (HasCallStack, MonadIO m, IsWidget a) | |
=> Maybe a |
|
-> Maybe Text |
|
-> m ToolButton | Returns: A new |
Creates a new ToolButton
using iconWidget
as contents and label
as
label.
Since: 2.4
newFromStock
toolButtonNewFromStock Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m ToolButton | Returns: A new |
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
data ToolButtonSetIconNameMethodInfo Source #
((~) * signature (Maybe Text -> m ()), MonadIO m, IsToolButton a) => MethodInfo * ToolButtonSetIconNameMethodInfo a signature Source # | |
toolButtonSetIconName Source #
:: (HasCallStack, MonadIO m, IsToolButton a) | |
=> a |
|
-> Maybe Text |
|
-> 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
data ToolButtonSetIconWidgetMethodInfo Source #
((~) * signature (Maybe b -> m ()), MonadIO m, IsToolButton a, IsWidget b) => MethodInfo * ToolButtonSetIconWidgetMethodInfo a signature Source # | |
toolButtonSetIconWidget Source #
:: (HasCallStack, MonadIO m, IsToolButton a, IsWidget b) | |
=> a |
|
-> Maybe b |
|
-> 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
data ToolButtonSetLabelMethodInfo Source #
((~) * signature (Maybe Text -> m ()), MonadIO m, IsToolButton a) => MethodInfo * ToolButtonSetLabelMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsToolButton a) | |
=> a |
|
-> Maybe Text |
|
-> 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
data ToolButtonSetLabelWidgetMethodInfo Source #
((~) * signature (Maybe b -> m ()), MonadIO m, IsToolButton a, IsWidget b) => MethodInfo * ToolButtonSetLabelWidgetMethodInfo a signature Source # | |
toolButtonSetLabelWidget Source #
:: (HasCallStack, MonadIO m, IsToolButton a, IsWidget b) | |
=> a |
|
-> Maybe b |
|
-> 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
data ToolButtonSetStockIdMethodInfo Source #
((~) * signature (Maybe Text -> m ()), MonadIO m, IsToolButton a) => MethodInfo * ToolButtonSetStockIdMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsToolButton a) | |
=> a |
|
-> Maybe Text |
|
-> 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
data ToolButtonSetUseUnderlineMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsToolButton a) => MethodInfo * ToolButtonSetUseUnderlineMethodInfo a signature Source # | |
toolButtonSetUseUnderline Source #
:: (HasCallStack, MonadIO m, IsToolButton a) | |
=> a |
|
-> Bool |
|
-> 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 #
clearToolButtonIconName :: (MonadIO m, IsToolButton o) => o -> m () Source #
constructToolButtonIconName :: IsToolButton o => Text -> IO (GValueConstruct o) Source #
getToolButtonIconName :: (MonadIO m, IsToolButton o) => o -> m (Maybe Text) Source #
setToolButtonIconName :: (MonadIO m, IsToolButton o) => o -> Text -> m () Source #
toolButtonIconName :: AttrLabelProxy "iconName" Source #
iconWidget
data ToolButtonIconWidgetPropertyInfo Source #
clearToolButtonIconWidget :: (MonadIO m, IsToolButton o) => o -> m () Source #
constructToolButtonIconWidget :: (IsToolButton o, IsWidget a) => a -> IO (GValueConstruct o) Source #
getToolButtonIconWidget :: (MonadIO m, IsToolButton o) => o -> m (Maybe Widget) Source #
setToolButtonIconWidget :: (MonadIO m, IsToolButton o, IsWidget a) => o -> a -> m () Source #
toolButtonIconWidget :: AttrLabelProxy "iconWidget" Source #
label
data ToolButtonLabelPropertyInfo Source #
clearToolButtonLabel :: (MonadIO m, IsToolButton o) => o -> m () Source #
constructToolButtonLabel :: IsToolButton o => Text -> IO (GValueConstruct o) Source #
getToolButtonLabel :: (MonadIO m, IsToolButton o) => o -> m (Maybe Text) Source #
setToolButtonLabel :: (MonadIO m, IsToolButton o) => o -> Text -> m () Source #
toolButtonLabel :: AttrLabelProxy "label" Source #
labelWidget
data ToolButtonLabelWidgetPropertyInfo Source #
clearToolButtonLabelWidget :: (MonadIO m, IsToolButton o) => o -> m () Source #
constructToolButtonLabelWidget :: (IsToolButton o, IsWidget a) => a -> IO (GValueConstruct o) Source #
getToolButtonLabelWidget :: (MonadIO m, IsToolButton o) => o -> m (Maybe Widget) Source #
setToolButtonLabelWidget :: (MonadIO m, IsToolButton o, IsWidget a) => o -> a -> m () Source #
toolButtonLabelWidget :: AttrLabelProxy "labelWidget" Source #
stockId
data ToolButtonStockIdPropertyInfo Source #
clearToolButtonStockId :: (MonadIO m, IsToolButton o) => o -> m () Source #
constructToolButtonStockId :: IsToolButton o => Text -> IO (GValueConstruct o) Source #
getToolButtonStockId :: (MonadIO m, IsToolButton o) => o -> m Text Source #
setToolButtonStockId :: (MonadIO m, IsToolButton o) => o -> Text -> m () Source #
toolButtonStockId :: AttrLabelProxy "stockId" Source #
useUnderline
data ToolButtonUseUnderlinePropertyInfo Source #
constructToolButtonUseUnderline :: IsToolButton o => Bool -> IO (GValueConstruct o) Source #
getToolButtonUseUnderline :: (MonadIO m, IsToolButton o) => o -> m Bool Source #
setToolButtonUseUnderline :: (MonadIO m, IsToolButton o) => o -> Bool -> m () Source #
toolButtonUseUnderline :: AttrLabelProxy "useUnderline" Source #
Signals
clicked
type ToolButtonClickedCallback = IO () Source #
afterToolButtonClicked :: (GObject a, MonadIO m) => a -> ToolButtonClickedCallback -> m SignalHandlerId Source #
mk_ToolButtonClickedCallback :: C_ToolButtonClickedCallback -> IO (FunPtr C_ToolButtonClickedCallback) Source #
onToolButtonClicked :: (GObject a, MonadIO m) => a -> ToolButtonClickedCallback -> m SignalHandlerId Source #
wrap_ToolButtonClickedCallback :: ToolButtonClickedCallback -> Ptr () -> Ptr () -> IO () Source #