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

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.

Synopsis

Exported types

newtype ToolItem Source #

Memory-managed wrapper type.

Constructors

ToolItem (ManagedPtr ToolItem) 

Instances

Instances details
Eq ToolItem Source # 
Instance details

Defined in GI.Gtk.Objects.ToolItem

IsGValue ToolItem Source #

Convert ToolItem to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.ToolItem

GObject ToolItem Source # 
Instance details

Defined in GI.Gtk.Objects.ToolItem

Methods

gobjectType :: IO GType #

HasParentTypes ToolItem Source # 
Instance details

Defined in GI.Gtk.Objects.ToolItem

type ParentTypes ToolItem Source # 
Instance details

Defined in GI.Gtk.Objects.ToolItem

class (GObject o, IsDescendantOf ToolItem o) => IsToolItem o Source #

Type class for types which can be safely cast to ToolItem, for instance with toToolItem.

Instances

Instances details
(GObject o, IsDescendantOf ToolItem o) => IsToolItem o Source # 
Instance details

Defined in GI.Gtk.Objects.ToolItem

toToolItem :: (MonadIO m, IsToolItem o) => o -> m ToolItem Source #

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

noToolItem :: Maybe ToolItem Source #

A convenience alias for Nothing :: Maybe ToolItem.

Methods

Overloaded methods

getEllipsizeMode

toolItemGetEllipsizeMode Source #

Arguments

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

toolItem: a ToolItem

-> m EllipsizeMode

Returns: a EllipsizeMode indicating how text in toolItem should be ellipsized.

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

toolItemGetExpand Source #

Arguments

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

toolItem: a ToolItem

-> m Bool

Returns: True if toolItem is allocated extra space.

Returns whether toolItem is allocated extra space. See toolItemSetExpand.

Since: 2.4

getHomogeneous

toolItemGetHomogeneous Source #

Arguments

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

toolItem: a ToolItem

-> m Bool

Returns: True if the item is the same size as other homogeneous items.

Returns whether toolItem is the same size as other homogeneous items. See toolItemSetHomogeneous.

Since: 2.4

getIconSize

toolItemGetIconSize Source #

Arguments

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

toolItem: a ToolItem

-> m Int32

Returns: a IconSize indicating the icon size used for toolItem

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

toolItem: a ToolItem

-> m Bool

Returns: True if toolItem is considered important.

Returns whether toolItem is considered important. See toolItemSetIsImportant

Since: 2.4

getOrientation

toolItemGetOrientation Source #

Arguments

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

toolItem: a ToolItem

-> m Orientation

Returns: a Orientation indicating the orientation used for toolItem

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

toolItem: a ToolItem

-> Text

menuItemId: a string used to identify the menu item

-> m (Maybe Widget)

Returns: The MenuItem passed to toolItemSetProxyMenuItem, if the menuItemIds match.

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

toolItem: a ToolItem

-> m ReliefStyle

Returns: a ReliefStyle indicating the relief style used for toolItem.

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

toolItem: a ToolItem:

-> m Float

Returns: a gfloat indicating the horizontal text alignment used for toolItem

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

toolItem: a ToolItem

-> m Orientation

Returns: a Orientation indicating the text orientation used for toolItem

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

toolItem: a ToolItem

-> m SizeGroup

Returns: a SizeGroup

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

toolItem: a ToolItem

-> m ToolbarStyle

Returns: A ToolbarStyle indicating the toolbar style used for toolItem.

Returns the toolbar style used for toolItem. Custom subclasses of ToolItem should call this function in the handler of the GtkToolItem[toolbar_reconfigured](#signal:toolbar_reconfigured) signal to find out in what style the toolbar is displayed and change themselves accordingly

Possibilities are:

Since: 2.4

getUseDragWindow

toolItemGetUseDragWindow Source #

Arguments

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

toolItem: a ToolItem

-> m Bool

Returns: True if toolItem uses a drag window.

Returns whether toolItem has a drag window. See toolItemSetUseDragWindow.

Since: 2.4

getVisibleHorizontal

toolItemGetVisibleHorizontal Source #

Arguments

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

toolItem: a ToolItem

-> m Bool

Returns: True if toolItem is visible on toolbars that are docked horizontally.

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

toolItem: a ToolItem

-> m Bool

Returns: Whether toolItem is visible when the toolbar is docked vertically

Returns whether toolItem is visible when the toolbar is docked vertically. See toolItemSetVisibleVertical.

Since: 2.4

new

toolItemNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m ToolItem

Returns: the new ToolItem

Creates a new ToolItem

Since: 2.4

rebuildMenu

toolItemRebuildMenu Source #

Arguments

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

toolItem: a ToolItem

-> 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 createMenuProxy signal.

Since: 2.6

retrieveProxyMenuItem

toolItemRetrieveProxyMenuItem Source #

Arguments

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

toolItem: a ToolItem

-> m Widget

Returns: The MenuItem that is going to appear in the overflow menu for toolItem.

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

toolItemSetExpand Source #

Arguments

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

toolItem: a ToolItem

-> Bool

expand: Whether toolItem is allocated extra space

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

toolItem: a ToolItem

-> Bool

homogeneous: whether toolItem is the same size as other homogeneous items

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

toolItem: a ToolItem

-> Bool

isImportant: whether the tool item should be considered important

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

toolItem: a ToolItem

-> Text

menuItemId: a string used to identify menuItem

-> Maybe b

menuItem: a MenuItem to use in the overflow menu, or Nothing

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

See also createMenuProxy.

Since: 2.4

setTooltipMarkup

toolItemSetTooltipMarkup Source #

Arguments

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

toolItem: a ToolItem

-> Text

markup: markup text to be used as tooltip for toolItem

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

toolItem: a ToolItem

-> Text

text: text to be used as tooltip for toolItem

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

toolItem: a ToolItem

-> Bool

useDragWindow: Whether toolItem has a drag window.

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

toolItem: a ToolItem

-> Bool

visibleHorizontal: Whether toolItem is visible when in horizontal mode

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

toolItem: a ToolItem

-> Bool

visibleVertical: whether toolItem is visible when the toolbar is in vertical mode

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

toolItem: a ToolItem

-> m () 

Emits the signal ToolItem::toolbar_reconfigured on toolItem. Toolbar and other ToolShell implementations use this function to notify children, when some aspect of their configuration changes.

Since: 2.14

Properties

isImportant

No description available in the introspection data.

constructToolItemIsImportant :: IsToolItem o => Bool -> IO (GValueConstruct o) Source #

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

getToolItemIsImportant :: (MonadIO m, IsToolItem o) => o -> m Bool Source #

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

get toolItem #isImportant

setToolItemIsImportant :: (MonadIO m, IsToolItem o) => o -> Bool -> m () Source #

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

set toolItem [ #isImportant := value ]

visibleHorizontal

No description available in the introspection data.

constructToolItemVisibleHorizontal :: IsToolItem o => Bool -> IO (GValueConstruct o) Source #

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

getToolItemVisibleHorizontal :: (MonadIO m, IsToolItem o) => o -> m Bool Source #

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

get toolItem #visibleHorizontal

setToolItemVisibleHorizontal :: (MonadIO m, IsToolItem o) => o -> Bool -> m () Source #

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

set toolItem [ #visibleHorizontal := value ]

visibleVertical

No description available in the introspection data.

constructToolItemVisibleVertical :: IsToolItem o => Bool -> IO (GValueConstruct o) Source #

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

getToolItemVisibleVertical :: (MonadIO m, IsToolItem o) => o -> m Bool Source #

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

get toolItem #visibleVertical

setToolItemVisibleVertical :: (MonadIO m, IsToolItem o) => o -> Bool -> m () Source #

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

set toolItem [ #visibleVertical := value ]

Signals

createMenuProxy

type C_ToolItemCreateMenuProxyCallback = Ptr () -> Ptr () -> IO CInt Source #

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

type ToolItemCreateMenuProxyCallback Source #

Arguments

 = IO Bool

Returns: True if the signal was handled, False if not

This signal is emitted when the toolbar needs information from toolItem about whether the item should appear in the toolbar overflow menu. In response the tool item should either

  • call toolItemSetProxyMenuItem with a Nothing pointer and return True to indicate that the item should not appear in the overflow menu
  • call toolItemSetProxyMenuItem with a new menu item and return True, or
  • return False to indicate that the signal was not handled by the item. This means that the item will not appear in the overflow menu unless a later handler installs a menu item.

The toolbar may cache the result of this signal. When the tool item changes how it will respond to this signal it must call toolItemRebuildMenu to invalidate the cache and ensure that the toolbar rebuilds its overflow menu.

afterToolItemCreateMenuProxy :: (IsToolItem a, MonadIO m) => a -> ToolItemCreateMenuProxyCallback -> m SignalHandlerId Source #

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

after toolItem #createMenuProxy callback

onToolItemCreateMenuProxy :: (IsToolItem a, MonadIO m) => a -> ToolItemCreateMenuProxyCallback -> m SignalHandlerId Source #

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

on toolItem #createMenuProxy callback

toolbarReconfigured

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

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

type ToolItemToolbarReconfiguredCallback = IO () Source #

This signal is emitted when some property of the toolbar that the item is a child of changes. For custom subclasses of ToolItem, the default handler of this signal use the functions

to find out what the toolbar should look like and change themselves accordingly.

afterToolItemToolbarReconfigured :: (IsToolItem a, MonadIO m) => a -> ToolItemToolbarReconfiguredCallback -> m SignalHandlerId Source #

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

after toolItem #toolbarReconfigured callback

onToolItemToolbarReconfigured :: (IsToolItem a, MonadIO m) => a -> ToolItemToolbarReconfiguredCallback -> m SignalHandlerId Source #

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

on toolItem #toolbarReconfigured callback