gi-gtk-3.0.11: Gtk bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.Toolbar

Contents

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.

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

CSS nodes

GtkToolbar has a single CSS node with name toolbar.

Synopsis

Exported types

Methods

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

data ToolbarInsertMethodInfo Source #

Instances

((~) * signature (b -> Int32 -> m ()), MonadIO m, IsToolbar a, IsToolItem b) => MethodInfo * ToolbarInsertMethodInfo a signature Source # 

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 doesn’t have room for all items on it. If True, items that there are not room are available through an overflow menu.

Since: 2.4

setStyle

data ToolbarSetStyleMethodInfo Source #

Instances

((~) * signature (ToolbarStyle -> m ()), MonadIO m, IsToolbar a) => MethodInfo * ToolbarSetStyleMethodInfo a signature Source # 

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

data ToolbarUnsetStyleMethodInfo Source #

Instances

((~) * signature (m ()), MonadIO m, IsToolbar a) => MethodInfo * ToolbarUnsetStyleMethodInfo a signature Source # 

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

data ToolbarIconSizePropertyInfo Source #

Instances

AttrInfo ToolbarIconSizePropertyInfo Source # 
type AttrOrigin ToolbarIconSizePropertyInfo Source # 
type AttrLabel ToolbarIconSizePropertyInfo Source # 
type AttrGetType ToolbarIconSizePropertyInfo Source # 
type AttrBaseTypeConstraint ToolbarIconSizePropertyInfo Source # 
type AttrSetTypeConstraint ToolbarIconSizePropertyInfo Source # 
type AttrAllowedOps ToolbarIconSizePropertyInfo Source # 

iconSizeSet

data ToolbarIconSizeSetPropertyInfo Source #

Instances

AttrInfo ToolbarIconSizeSetPropertyInfo Source # 
type AttrOrigin ToolbarIconSizeSetPropertyInfo Source # 
type AttrLabel ToolbarIconSizeSetPropertyInfo Source # 
type AttrGetType ToolbarIconSizeSetPropertyInfo Source # 
type AttrBaseTypeConstraint ToolbarIconSizeSetPropertyInfo Source # 
type AttrSetTypeConstraint ToolbarIconSizeSetPropertyInfo Source # 
type AttrAllowedOps ToolbarIconSizeSetPropertyInfo Source # 

showArrow

data ToolbarShowArrowPropertyInfo Source #

Instances

AttrInfo ToolbarShowArrowPropertyInfo Source # 
type AttrOrigin ToolbarShowArrowPropertyInfo Source # 
type AttrLabel ToolbarShowArrowPropertyInfo Source # 
type AttrGetType ToolbarShowArrowPropertyInfo Source # 
type AttrBaseTypeConstraint ToolbarShowArrowPropertyInfo Source # 
type AttrSetTypeConstraint ToolbarShowArrowPropertyInfo Source # 
type AttrAllowedOps ToolbarShowArrowPropertyInfo Source # 

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

toolbarStyle

data ToolbarToolbarStylePropertyInfo Source #

Instances

AttrInfo ToolbarToolbarStylePropertyInfo Source # 
type AttrOrigin ToolbarToolbarStylePropertyInfo Source # 
type AttrLabel ToolbarToolbarStylePropertyInfo Source # 
type AttrGetType ToolbarToolbarStylePropertyInfo Source # 
type AttrBaseTypeConstraint ToolbarToolbarStylePropertyInfo Source # 
type AttrSetTypeConstraint ToolbarToolbarStylePropertyInfo Source # 
type AttrAllowedOps ToolbarToolbarStylePropertyInfo Source # 

Signals

focusHomeOrEnd

orientationChanged

popupContextMenu

styleChanged