gi-gtk-3.0.29: Gtk bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
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.

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:show-arrow to False.

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

newtype Toolbar Source #

Memory-managed wrapper type.

Constructors

Toolbar (ManagedPtr Toolbar) 
Instances
GObject Toolbar Source # 
Instance details

Defined in GI.Gtk.Objects.Toolbar

Methods

gobjectType :: IO GType #

HasParentTypes Toolbar Source # 
Instance details

Defined in GI.Gtk.Objects.Toolbar

type ParentTypes Toolbar Source # 
Instance details

Defined in GI.Gtk.Objects.Toolbar

type ParentTypes Toolbar = Container ': (Widget ': (Object ': (ImplementorIface ': (Buildable ': (Orientable ': (ToolShell ': ([] :: [Type])))))))

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

noToolbar :: Maybe Toolbar Source #

A convenience alias for Nothing :: Maybe Toolbar.

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

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::create-menu-proxy, 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 => IconSize -> IO (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 => Bool -> IO (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 => Bool -> IO (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 => ToolbarStyle -> IO (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 C_ToolbarFocusHomeOrEndCallback = Ptr () -> CInt -> Ptr () -> IO CInt Source #

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

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 -> ToolbarFocusHomeOrEndCallback -> m SignalHandlerId Source #

Connect a signal handler for the “focus-home-or-end” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after toolbar #focusHomeOrEnd callback

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

Connect a signal handler for the “focus-home-or-end” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on toolbar #focusHomeOrEnd callback

orientationChanged

type C_ToolbarOrientationChangedCallback = Ptr () -> CUInt -> Ptr () -> IO () Source #

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

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 -> ToolbarOrientationChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “orientation-changed” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after toolbar #orientationChanged callback

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

Connect a signal handler for the “orientation-changed” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on toolbar #orientationChanged callback

popupContextMenu

type C_ToolbarPopupContextMenuCallback = Ptr () -> Int32 -> Int32 -> Int32 -> Ptr () -> IO CInt Source #

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

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 -> ToolbarPopupContextMenuCallback -> m SignalHandlerId Source #

Connect a signal handler for the “popup-context-menu” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after toolbar #popupContextMenu callback

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

Connect a signal handler for the “popup-context-menu” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on toolbar #popupContextMenu callback

styleChanged

type C_ToolbarStyleChangedCallback = Ptr () -> CUInt -> Ptr () -> IO () Source #

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

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 -> ToolbarStyleChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the “style-changed” signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after toolbar #styleChanged callback

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

Connect a signal handler for the “style-changed” signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on toolbar #styleChanged callback