gi-gtk-3.0.41: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.Toolbar

Description

A toolbar is created with a call to toolbarNew.

A toolbar can contain instances of a subclass of ToolItem. To add a ToolItem to the a toolbar, use toolbarInsert. To remove an item from the toolbar use containerRemove. To add a button to the toolbar, add an instance of ToolButton.

Toolbar items can be visually grouped by adding instances of SeparatorToolItem to the toolbar. If the GtkToolbar child property “expand” is TRUE and the property SeparatorToolItem:draw is set to FALSE, the effect is to force all following items to the end of the toolbar.

By default, a toolbar can be shrunk, upon which it will add an arrow button to show an overflow menu offering access to any ToolItem child that has a proxy menu item. To disable this and request enough size for all children, call toolbarSetShowArrow to set Toolbar:showArrow to False.

Creating a context menu for the toolbar can be done by connecting to the Toolbar::popupContextMenu signal.

CSS nodes

GtkToolbar has a single CSS node with name toolbar.

Synopsis

Exported types

newtype Toolbar Source #

Memory-managed wrapper type.

Constructors

Toolbar (ManagedPtr Toolbar) 

Instances

Instances details
Eq Toolbar Source # 
Instance details

Defined in GI.Gtk.Objects.Toolbar

Methods

(==) :: Toolbar -> Toolbar -> Bool #

(/=) :: Toolbar -> Toolbar -> Bool #

GObject Toolbar Source # 
Instance details

Defined in GI.Gtk.Objects.Toolbar

ManagedPtrNewtype Toolbar Source # 
Instance details

Defined in GI.Gtk.Objects.Toolbar

Methods

toManagedPtr :: Toolbar -> ManagedPtr Toolbar

TypedObject Toolbar Source # 
Instance details

Defined in GI.Gtk.Objects.Toolbar

Methods

glibType :: IO GType

HasParentTypes Toolbar Source # 
Instance details

Defined in GI.Gtk.Objects.Toolbar

IsGValue (Maybe Toolbar) Source #

Convert Toolbar to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.Toolbar

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Toolbar -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Toolbar)

type ParentTypes Toolbar Source # 
Instance details

Defined in GI.Gtk.Objects.Toolbar

type ParentTypes Toolbar = '[Container, Widget, Object, ImplementorIface, Buildable, Orientable, ToolShell]

class (GObject o, IsDescendantOf Toolbar o) => IsToolbar o Source #

Type class for types which can be safely cast to Toolbar, for instance with toToolbar.

Instances

Instances details
(GObject o, IsDescendantOf Toolbar o) => IsToolbar o Source # 
Instance details

Defined in GI.Gtk.Objects.Toolbar

toToolbar :: (MonadIO m, IsToolbar o) => o -> m Toolbar Source #

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

Methods

Click to display all available methods, including inherited ones

Expand

Methods

activate, add, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, bindProperty, bindPropertyFull, canActivateAccel, checkResize, childFocus, childGetProperty, childNotify, childNotifyByPspec, childSetProperty, childType, classPath, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, destroy, destroyed, deviceIsShadowed, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, ensureStyle, errorBell, event, forall, forceFloating, foreach, freezeChildNotify, freezeNotify, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, inDestruction, initTemplate, inputShapeCombineRegion, insert, insertActionGroup, intersect, isAncestor, isComposited, isDrawable, isFloating, isFocus, isSensitive, isToplevel, isVisible, keynavFailed, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parserFinished, path, propagateDraw, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, rebuildMenu, ref, refSink, regionIntersect, registerWindow, remove, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, resizeChildren, runDispose, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, styleAttach, styleGetProperty, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unsetFocusChain, unsetIconSize, unsetStateFlags, unsetStyle, watchClosure.

Getters

getAccessible, getActionGroup, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getBorderWidth, getCanDefault, getCanFocus, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getDropIndex, getEllipsizeMode, getEvents, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getIconSize, getInternalChild, getItemIndex, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getModifierMask, getModifierStyle, getNItems, getName, getNoShowAll, getNthItem, getOpacity, getOrientation, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getReliefStyle, getRequestMode, getRequisition, getResizeMode, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getShowArrow, getSizeRequest, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTextAlignment, getTextOrientation, getTextSizeGroup, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getWindow.

Setters

setAccelPath, setAllocation, setAppPaintable, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setDropHighlightItem, setEvents, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setIconSize, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNoShowAll, setOpacity, setOrientation, setParent, setParentWindow, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setSensitive, setShowArrow, setSizeRequest, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow.

getDropIndex

toolbarGetDropIndex Source #

Arguments

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

toolbar: a Toolbar

-> Int32

x: x coordinate of a point on the toolbar

-> Int32

y: y coordinate of a point on the toolbar

-> m Int32

Returns: The position corresponding to the point (x, y) on the toolbar.

Returns the position corresponding to the indicated point on toolbar. This is useful when dragging items to the toolbar: this function returns the position a new item should be inserted.

x and y are in toolbar coordinates.

Since: 2.4

getIconSize

toolbarGetIconSize Source #

Arguments

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

toolbar: a Toolbar

-> m IconSize

Returns: the current icon size for the icons on the toolbar.

Retrieves the icon size for the toolbar. See toolbarSetIconSize.

getItemIndex

toolbarGetItemIndex Source #

Arguments

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

toolbar: a Toolbar

-> b

item: a ToolItem that is a child of toolbar

-> m Int32

Returns: the position of item on the toolbar.

Returns the position of item on the toolbar, starting from 0. It is an error if item is not a child of the toolbar.

Since: 2.4

getNItems

toolbarGetNItems Source #

Arguments

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

toolbar: a Toolbar

-> m Int32

Returns: the number of items on the toolbar

Returns the number of items on the toolbar.

Since: 2.4

getNthItem

toolbarGetNthItem Source #

Arguments

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

toolbar: a Toolbar

-> Int32

n: A position on the toolbar

-> m (Maybe ToolItem)

Returns: The n'th ToolItem on toolbar, or Nothing if there isn’t an n'th item.

Returns the n'th item on toolbar, or Nothing if the toolbar does not contain an n'th item.

Since: 2.4

getReliefStyle

toolbarGetReliefStyle Source #

Arguments

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

toolbar: a Toolbar

-> m ReliefStyle

Returns: The relief style of buttons on toolbar.

Returns the relief style of buttons on toolbar. See buttonSetRelief.

Since: 2.4

getShowArrow

toolbarGetShowArrow Source #

Arguments

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

toolbar: a Toolbar

-> m Bool

Returns: True if the toolbar has an overflow menu.

Returns whether the toolbar has an overflow menu. See toolbarSetShowArrow.

Since: 2.4

getStyle

toolbarGetStyle Source #

Arguments

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

toolbar: a Toolbar

-> m ToolbarStyle

Returns: the current style of toolbar

Retrieves whether the toolbar has text, icons, or both . See toolbarSetStyle.

insert

toolbarInsert Source #

Arguments

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

toolbar: a Toolbar

-> b

item: a ToolItem

-> Int32

pos: the position of the new item

-> m () 

Insert a ToolItem into the toolbar at position pos. If pos is 0 the item is prepended to the start of the toolbar. If pos is negative, the item is appended to the end of the toolbar.

Since: 2.4

new

toolbarNew Source #

Arguments

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

Returns: the newly-created toolbar.

Creates a new toolbar.

setDropHighlightItem

toolbarSetDropHighlightItem Source #

Arguments

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

toolbar: a Toolbar

-> Maybe b

toolItem: a ToolItem, or Nothing to turn of highlighting

-> Int32

index_: a position on toolbar

-> m () 

Highlights toolbar to give an idea of what it would look like if item was added to toolbar at the position indicated by index_. If item is Nothing, highlighting is turned off. In that case index_ is ignored.

The toolItem passed to this function must not be part of any widget hierarchy. When an item is set as drop highlight item it can not added to any widget hierarchy or used as highlight item for another toolbar.

Since: 2.4

setIconSize

toolbarSetIconSize Source #

Arguments

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

toolbar: A Toolbar

-> IconSize

iconSize: The IconSize that stock icons in the toolbar shall have.

-> m () 

This function sets the size of stock icons in the toolbar. You can call it both before you add the icons and after they’ve been added. The size you set will override user preferences for the default icon size.

This should only be used for special-purpose toolbars, normal application toolbars should respect the user preferences for the size of icons.

setShowArrow

toolbarSetShowArrow Source #

Arguments

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

toolbar: a Toolbar

-> Bool

showArrow: Whether to show an overflow menu

-> m () 

Sets whether to show an overflow menu when toolbar isn’t allocated enough size to show all of its items. If True, items which can’t fit in toolbar, and which have a proxy menu item set by toolItemSetProxyMenuItem or ToolItem::createMenuProxy, will be available in an overflow menu, which can be opened by an added arrow button. If False, toolbar will request enough size to fit all of its child items without any overflow.

Since: 2.4

setStyle

toolbarSetStyle Source #

Arguments

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

toolbar: a Toolbar.

-> ToolbarStyle

style: the new style for toolbar.

-> m () 

Alters the view of toolbar to display either icons only, text only, or both.

unsetIconSize

toolbarUnsetIconSize Source #

Arguments

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

toolbar: a Toolbar

-> m () 

Unsets toolbar icon size set with toolbarSetIconSize, so that user preferences will be used to determine the icon size.

unsetStyle

toolbarUnsetStyle Source #

Arguments

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

toolbar: a Toolbar

-> m () 

Unsets a toolbar style set with toolbarSetStyle, so that user preferences will be used to determine the toolbar style.

Properties

iconSize

The size of the icons in a toolbar is normally determined by the toolbar-icon-size setting. When this property is set, it overrides the setting.

This should only be used for special-purpose toolbars, normal application toolbars should respect the user preferences for the size of icons.

Since: 2.10

constructToolbarIconSize :: (IsToolbar o, MonadIO m) => IconSize -> m (GValueConstruct o) Source #

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

getToolbarIconSize :: (MonadIO m, IsToolbar o) => o -> m IconSize Source #

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

get toolbar #iconSize

setToolbarIconSize :: (MonadIO m, IsToolbar o) => o -> IconSize -> m () Source #

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

set toolbar [ #iconSize := value ]

iconSizeSet

Is True if the icon-size property has been set.

Since: 2.10

constructToolbarIconSizeSet :: (IsToolbar o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getToolbarIconSizeSet :: (MonadIO m, IsToolbar o) => o -> m Bool Source #

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

get toolbar #iconSizeSet

setToolbarIconSizeSet :: (MonadIO m, IsToolbar o) => o -> Bool -> m () Source #

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

set toolbar [ #iconSizeSet := value ]

showArrow

No description available in the introspection data.

constructToolbarShowArrow :: (IsToolbar o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getToolbarShowArrow :: (MonadIO m, IsToolbar o) => o -> m Bool Source #

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

get toolbar #showArrow

setToolbarShowArrow :: (MonadIO m, IsToolbar o) => o -> Bool -> m () Source #

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

set toolbar [ #showArrow := value ]

toolbarStyle

No description available in the introspection data.

constructToolbarToolbarStyle :: (IsToolbar o, MonadIO m) => ToolbarStyle -> m (GValueConstruct o) Source #

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

getToolbarToolbarStyle :: (MonadIO m, IsToolbar o) => o -> m ToolbarStyle Source #

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

get toolbar #toolbarStyle

setToolbarToolbarStyle :: (MonadIO m, IsToolbar o) => o -> ToolbarStyle -> m () Source #

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

set toolbar [ #toolbarStyle := value ]

Signals

focusHomeOrEnd

type ToolbarFocusHomeOrEndCallback Source #

Arguments

 = Bool

focusHome: True if the first item should be focused

-> IO Bool

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

A keybinding signal used internally by GTK+. This signal can't be used in application code

afterToolbarFocusHomeOrEnd :: (IsToolbar a, MonadIO m) => a -> ((?self :: a) => ToolbarFocusHomeOrEndCallback) -> m SignalHandlerId Source #

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

after toolbar #focusHomeOrEnd callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onToolbarFocusHomeOrEnd :: (IsToolbar a, MonadIO m) => a -> ((?self :: a) => ToolbarFocusHomeOrEndCallback) -> m SignalHandlerId Source #

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

on toolbar #focusHomeOrEnd callback

orientationChanged

type ToolbarOrientationChangedCallback Source #

Arguments

 = Orientation

orientation: the new Orientation of the toolbar

-> IO () 

Emitted when the orientation of the toolbar changes.

afterToolbarOrientationChanged :: (IsToolbar a, MonadIO m) => a -> ((?self :: a) => ToolbarOrientationChangedCallback) -> m SignalHandlerId Source #

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

after toolbar #orientationChanged callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onToolbarOrientationChanged :: (IsToolbar a, MonadIO m) => a -> ((?self :: a) => ToolbarOrientationChangedCallback) -> m SignalHandlerId Source #

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

on toolbar #orientationChanged callback

popupContextMenu

type ToolbarPopupContextMenuCallback Source #

Arguments

 = Int32

x: the x coordinate of the point where the menu should appear

-> Int32

y: the y coordinate of the point where the menu should appear

-> Int32

button: the mouse button the user pressed, or -1

-> IO Bool

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

Emitted when the user right-clicks the toolbar or uses the keybinding to display a popup menu.

Application developers should handle this signal if they want to display a context menu on the toolbar. The context-menu should appear at the coordinates given by x and y. The mouse button number is given by the button parameter. If the menu was popped up using the keybaord, button is -1.

afterToolbarPopupContextMenu :: (IsToolbar a, MonadIO m) => a -> ((?self :: a) => ToolbarPopupContextMenuCallback) -> m SignalHandlerId Source #

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

after toolbar #popupContextMenu callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onToolbarPopupContextMenu :: (IsToolbar a, MonadIO m) => a -> ((?self :: a) => ToolbarPopupContextMenuCallback) -> m SignalHandlerId Source #

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

on toolbar #popupContextMenu callback

styleChanged

type ToolbarStyleChangedCallback Source #

Arguments

 = ToolbarStyle

style: the new ToolbarStyle of the toolbar

-> IO () 

Emitted when the style of the toolbar changes.

afterToolbarStyleChanged :: (IsToolbar a, MonadIO m) => a -> ((?self :: a) => ToolbarStyleChangedCallback) -> m SignalHandlerId Source #

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

after toolbar #styleChanged callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onToolbarStyleChanged :: (IsToolbar a, MonadIO m) => a -> ((?self :: a) => ToolbarStyleChangedCallback) -> m SignalHandlerId Source #

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

on toolbar #styleChanged callback