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 |
GI.Gtk.Objects.ToolItem
Contents
- Exported types
- Methods
- getEllipsizeMode
- getExpand
- getHomogeneous
- getIconSize
- getIsImportant
- getOrientation
- getProxyMenuItem
- getReliefStyle
- getTextAlignment
- getTextOrientation
- getTextSizeGroup
- getToolbarStyle
- getUseDragWindow
- getVisibleHorizontal
- getVisibleVertical
- new
- rebuildMenu
- retrieveProxyMenuItem
- setExpand
- setHomogeneous
- setIsImportant
- setProxyMenuItem
- setTooltipMarkup
- setTooltipText
- setUseDragWindow
- setVisibleHorizontal
- setVisibleVertical
- toolbarReconfigured
- Properties
- Signals
Description
GtkToolItems
are widgets that can appear on a toolbar. To
create a toolbar item that contain something else than a button, use
toolItemNew
. Use containerAdd
to add a child
widget to the tool item.
For toolbar items that contain buttons, see the ToolButton
,
ToggleToolButton
and RadioToolButton
classes.
See the Toolbar
class for a description of the toolbar widget, and
ToolShell
for a description of the tool shell interface.
- newtype ToolItem = ToolItem (ManagedPtr ToolItem)
- class GObject o => IsToolItem o
- toToolItem :: (MonadIO m, IsToolItem o) => o -> m ToolItem
- noToolItem :: Maybe ToolItem
- toolItemGetEllipsizeMode :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m EllipsizeMode
- toolItemGetExpand :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m Bool
- toolItemGetHomogeneous :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m Bool
- toolItemGetIconSize :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m Int32
- toolItemGetIsImportant :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m Bool
- toolItemGetOrientation :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m Orientation
- toolItemGetProxyMenuItem :: (HasCallStack, MonadIO m, IsToolItem a) => a -> Text -> m Widget
- toolItemGetReliefStyle :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m ReliefStyle
- toolItemGetTextAlignment :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m Float
- toolItemGetTextOrientation :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m Orientation
- toolItemGetTextSizeGroup :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m SizeGroup
- toolItemGetToolbarStyle :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m ToolbarStyle
- toolItemGetUseDragWindow :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m Bool
- toolItemGetVisibleHorizontal :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m Bool
- toolItemGetVisibleVertical :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m Bool
- toolItemNew :: (HasCallStack, MonadIO m) => m ToolItem
- toolItemRebuildMenu :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m ()
- toolItemRetrieveProxyMenuItem :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m Widget
- toolItemSetExpand :: (HasCallStack, MonadIO m, IsToolItem a) => a -> Bool -> m ()
- toolItemSetHomogeneous :: (HasCallStack, MonadIO m, IsToolItem a) => a -> Bool -> m ()
- toolItemSetIsImportant :: (HasCallStack, MonadIO m, IsToolItem a) => a -> Bool -> m ()
- toolItemSetProxyMenuItem :: (HasCallStack, MonadIO m, IsToolItem a, IsWidget b) => a -> Text -> b -> m ()
- toolItemSetTooltipMarkup :: (HasCallStack, MonadIO m, IsToolItem a) => a -> Text -> m ()
- toolItemSetTooltipText :: (HasCallStack, MonadIO m, IsToolItem a) => a -> Text -> m ()
- toolItemSetUseDragWindow :: (HasCallStack, MonadIO m, IsToolItem a) => a -> Bool -> m ()
- toolItemSetVisibleHorizontal :: (HasCallStack, MonadIO m, IsToolItem a) => a -> Bool -> m ()
- toolItemSetVisibleVertical :: (HasCallStack, MonadIO m, IsToolItem a) => a -> Bool -> m ()
- toolItemToolbarReconfigured :: (HasCallStack, MonadIO m, IsToolItem a) => a -> m ()
- constructToolItemIsImportant :: IsToolItem o => Bool -> IO (GValueConstruct o)
- getToolItemIsImportant :: (MonadIO m, IsToolItem o) => o -> m Bool
- setToolItemIsImportant :: (MonadIO m, IsToolItem o) => o -> Bool -> m ()
- constructToolItemVisibleHorizontal :: IsToolItem o => Bool -> IO (GValueConstruct o)
- getToolItemVisibleHorizontal :: (MonadIO m, IsToolItem o) => o -> m Bool
- setToolItemVisibleHorizontal :: (MonadIO m, IsToolItem o) => o -> Bool -> m ()
- constructToolItemVisibleVertical :: IsToolItem o => Bool -> IO (GValueConstruct o)
- getToolItemVisibleVertical :: (MonadIO m, IsToolItem o) => o -> m Bool
- setToolItemVisibleVertical :: (MonadIO m, IsToolItem o) => o -> Bool -> m ()
- type C_ToolItemCreateMenuProxyCallback = Ptr () -> Ptr () -> IO CInt
- type ToolItemCreateMenuProxyCallback = IO Bool
- afterToolItemCreateMenuProxy :: (IsToolItem a, MonadIO m) => a -> ToolItemCreateMenuProxyCallback -> m SignalHandlerId
- genClosure_ToolItemCreateMenuProxy :: ToolItemCreateMenuProxyCallback -> IO Closure
- mk_ToolItemCreateMenuProxyCallback :: C_ToolItemCreateMenuProxyCallback -> IO (FunPtr C_ToolItemCreateMenuProxyCallback)
- noToolItemCreateMenuProxyCallback :: Maybe ToolItemCreateMenuProxyCallback
- onToolItemCreateMenuProxy :: (IsToolItem a, MonadIO m) => a -> ToolItemCreateMenuProxyCallback -> m SignalHandlerId
- wrap_ToolItemCreateMenuProxyCallback :: ToolItemCreateMenuProxyCallback -> Ptr () -> Ptr () -> IO CInt
- type C_ToolItemToolbarReconfiguredCallback = Ptr () -> Ptr () -> IO ()
- type ToolItemToolbarReconfiguredCallback = IO ()
- afterToolItemToolbarReconfigured :: (IsToolItem a, MonadIO m) => a -> ToolItemToolbarReconfiguredCallback -> m SignalHandlerId
- genClosure_ToolItemToolbarReconfigured :: ToolItemToolbarReconfiguredCallback -> IO Closure
- mk_ToolItemToolbarReconfiguredCallback :: C_ToolItemToolbarReconfiguredCallback -> IO (FunPtr C_ToolItemToolbarReconfiguredCallback)
- noToolItemToolbarReconfiguredCallback :: Maybe ToolItemToolbarReconfiguredCallback
- onToolItemToolbarReconfigured :: (IsToolItem a, MonadIO m) => a -> ToolItemToolbarReconfiguredCallback -> m SignalHandlerId
- wrap_ToolItemToolbarReconfiguredCallback :: ToolItemToolbarReconfiguredCallback -> Ptr () -> Ptr () -> IO ()
Exported types
Constructors
ToolItem (ManagedPtr ToolItem) |
class GObject o => IsToolItem o Source #
toToolItem :: (MonadIO m, IsToolItem o) => o -> m ToolItem Source #
Methods
getEllipsizeMode
toolItemGetEllipsizeMode Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m EllipsizeMode | Returns: a |
Returns the ellipsize mode used for toolItem
. Custom subclasses of
ToolItem
should call this function to find out how text should
be ellipsized.
Since: 2.20
getExpand
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether toolItem
is allocated extra space.
See toolItemSetExpand
.
Since: 2.4
getHomogeneous
toolItemGetHomogeneous Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether toolItem
is the same size as other homogeneous
items. See toolItemSetHomogeneous
.
Since: 2.4
getIconSize
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m Int32 | Returns: a |
Returns the icon size used for toolItem
. Custom subclasses of
ToolItem
should call this function to find out what size icons
they should use.
Since: 2.4
getIsImportant
toolItemGetIsImportant Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether toolItem
is considered important. See
toolItemSetIsImportant
Since: 2.4
getOrientation
toolItemGetOrientation Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m Orientation | Returns: a |
Returns the orientation used for toolItem
. Custom subclasses of
ToolItem
should call this function to find out what size icons
they should use.
Since: 2.4
getProxyMenuItem
toolItemGetProxyMenuItem Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> Text |
|
-> m Widget | Returns: The |
If menuItemId
matches the string passed to
toolItemSetProxyMenuItem
return the corresponding MenuItem
.
Custom subclasses of ToolItem
should use this function to
update their menu item when the ToolItem
changes. That the
menuItemIds
must match ensures that a ToolItem
will not inadvertently change a menu item that they did not create.
Since: 2.4
getReliefStyle
toolItemGetReliefStyle Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m ReliefStyle | Returns: a |
Returns the relief style of toolItem
. See buttonSetRelief
.
Custom subclasses of ToolItem
should call this function in the handler
of the ToolItem
::toolbar_reconfigured
signal to find out the
relief style of buttons.
Since: 2.4
getTextAlignment
toolItemGetTextAlignment Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m Float | Returns: a |
Returns the text alignment used for toolItem
. Custom subclasses of
ToolItem
should call this function to find out how text should
be aligned.
Since: 2.20
getTextOrientation
toolItemGetTextOrientation Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m Orientation | Returns: a |
Returns the text orientation used for toolItem
. Custom subclasses of
ToolItem
should call this function to find out how text should
be orientated.
Since: 2.20
getTextSizeGroup
toolItemGetTextSizeGroup Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m SizeGroup | Returns: a |
Returns the size group used for labels in toolItem
.
Custom subclasses of ToolItem
should call this function
and use the size group for labels.
Since: 2.20
getToolbarStyle
toolItemGetToolbarStyle Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m ToolbarStyle | Returns: A |
Returns the toolbar style used for toolItem
. Custom subclasses of
ToolItem
should call this function in the handler of the
GtkToolItem::toolbar_reconfigured signal to find out in what style
the toolbar is displayed and change themselves accordingly
Possibilities are:
ToolbarStyleBoth
, meaning the tool item should show both an icon and a label, stacked verticallyToolbarStyleIcons
, meaning the toolbar shows only iconsToolbarStyleText
, meaning the tool item should only show textToolbarStyleBothHoriz
, meaning the tool item should show both an icon and a label, arranged horizontally
Since: 2.4
getUseDragWindow
toolItemGetUseDragWindow Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether toolItem
has a drag window. See
toolItemSetUseDragWindow
.
Since: 2.4
getVisibleHorizontal
toolItemGetVisibleHorizontal Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether the toolItem
is visible on toolbars that are
docked horizontally.
Since: 2.4
getVisibleVertical
toolItemGetVisibleVertical Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m Bool | Returns: Whether |
Returns whether toolItem
is visible when the toolbar is docked vertically.
See toolItemSetVisibleVertical
.
Since: 2.4
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> m ToolItem | Returns: the new |
Creates a new ToolItem
Since: 2.4
rebuildMenu
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m () |
Calling this function signals to the toolbar that the
overflow menu item for toolItem
has changed. If the
overflow menu is visible when this function it called,
the menu will be rebuilt.
The function must be called when the tool item changes what it
will do in response to the ToolItem
::create-menu-proxy
signal.
Since: 2.6
retrieveProxyMenuItem
toolItemRetrieveProxyMenuItem Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m Widget | Returns: The |
Returns the MenuItem
that was last set by
toolItemSetProxyMenuItem
, ie. the MenuItem
that is going to appear in the overflow menu.
Since: 2.4
setExpand
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether toolItem
is allocated extra space when there
is more room on the toolbar then needed for the items. The
effect is that the item gets bigger when the toolbar gets bigger
and smaller when the toolbar gets smaller.
Since: 2.4
setHomogeneous
toolItemSetHomogeneous Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether toolItem
is to be allocated the same size as other
homogeneous items. The effect is that all homogeneous items will have
the same width as the widest of the items.
Since: 2.4
setIsImportant
toolItemSetIsImportant Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether toolItem
should be considered important. The ToolButton
class uses this property to determine whether to show or hide its label
when the toolbar style is ToolbarStyleBothHoriz
. The result is that
only tool buttons with the “is_important” property set have labels, an
effect known as “priority text”
Since: 2.4
setProxyMenuItem
toolItemSetProxyMenuItem Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a, IsWidget b) | |
=> a |
|
-> Text |
|
-> b |
|
-> m () |
Sets the MenuItem
used in the toolbar overflow menu. The
menuItemId
is used to identify the caller of this function and
should also be used with toolItemGetProxyMenuItem
.
Since: 2.4
setTooltipMarkup
toolItemSetTooltipMarkup Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the markup text to be displayed as tooltip on the item.
See widgetSetTooltipMarkup
.
Since: 2.12
setTooltipText
toolItemSetTooltipText Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the text to be displayed as tooltip on the item.
See widgetSetTooltipText
.
Since: 2.12
setUseDragWindow
toolItemSetUseDragWindow Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether toolItem
has a drag window. When True
the
toolitem can be used as a drag source through widgetDragSourceSet
.
When toolItem
has a drag window it will intercept all events,
even those that would otherwise be sent to a child of toolItem
.
Since: 2.4
setVisibleHorizontal
toolItemSetVisibleHorizontal Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether toolItem
is visible when the toolbar is docked horizontally.
Since: 2.4
setVisibleVertical
toolItemSetVisibleVertical Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether toolItem
is visible when the toolbar is docked
vertically. Some tool items, such as text entries, are too wide to be
useful on a vertically docked toolbar. If visibleVertical
is False
toolItem
will not appear on toolbars that are docked vertically.
Since: 2.4
toolbarReconfigured
toolItemToolbarReconfigured Source #
Arguments
:: (HasCallStack, MonadIO m, IsToolItem a) | |
=> a |
|
-> m () |
Properties
isImportant
constructToolItemIsImportant :: IsToolItem o => Bool -> IO (GValueConstruct o) Source #
getToolItemIsImportant :: (MonadIO m, IsToolItem o) => o -> m Bool Source #
setToolItemIsImportant :: (MonadIO m, IsToolItem o) => o -> Bool -> m () Source #
visibleHorizontal
constructToolItemVisibleHorizontal :: IsToolItem o => Bool -> IO (GValueConstruct o) Source #
getToolItemVisibleHorizontal :: (MonadIO m, IsToolItem o) => o -> m Bool Source #
setToolItemVisibleHorizontal :: (MonadIO m, IsToolItem o) => o -> Bool -> m () Source #
visibleVertical
constructToolItemVisibleVertical :: IsToolItem o => Bool -> IO (GValueConstruct o) Source #
getToolItemVisibleVertical :: (MonadIO m, IsToolItem o) => o -> m Bool Source #
setToolItemVisibleVertical :: (MonadIO m, IsToolItem o) => o -> Bool -> m () Source #
Signals
createMenuProxy
type ToolItemCreateMenuProxyCallback = IO Bool Source #
afterToolItemCreateMenuProxy :: (IsToolItem a, MonadIO m) => a -> ToolItemCreateMenuProxyCallback -> m SignalHandlerId Source #
mk_ToolItemCreateMenuProxyCallback :: C_ToolItemCreateMenuProxyCallback -> IO (FunPtr C_ToolItemCreateMenuProxyCallback) Source #
onToolItemCreateMenuProxy :: (IsToolItem a, MonadIO m) => a -> ToolItemCreateMenuProxyCallback -> m SignalHandlerId Source #
wrap_ToolItemCreateMenuProxyCallback :: ToolItemCreateMenuProxyCallback -> Ptr () -> Ptr () -> IO CInt Source #
toolbarReconfigured
type ToolItemToolbarReconfiguredCallback = IO () Source #
afterToolItemToolbarReconfigured :: (IsToolItem a, MonadIO m) => a -> ToolItemToolbarReconfiguredCallback -> m SignalHandlerId Source #
genClosure_ToolItemToolbarReconfigured :: ToolItemToolbarReconfiguredCallback -> IO Closure Source #
mk_ToolItemToolbarReconfiguredCallback :: C_ToolItemToolbarReconfiguredCallback -> IO (FunPtr C_ToolItemToolbarReconfiguredCallback) Source #
onToolItemToolbarReconfigured :: (IsToolItem a, MonadIO m) => a -> ToolItemToolbarReconfiguredCallback -> m SignalHandlerId Source #
wrap_ToolItemToolbarReconfiguredCallback :: ToolItemToolbarReconfiguredCallback -> Ptr () -> Ptr () -> IO () Source #