gtk.toolbar

Module for [Toolbar] class

Types 3

A toolbar is created with a call to gtk.toolbar.Toolbar.new_.

A toolbar can contain instances of a subclass of #GtkToolItem. To add a #GtkToolItem to the a toolbar, use gtk.toolbar.Toolbar.insert. To remove an item from the toolbar use gtk.container.Container.remove. To add a button to the toolbar, add an instance of #GtkToolButton.

Toolbar items can be visually grouped by adding instances of #GtkSeparatorToolItem to the toolbar. If the GtkToolbar child property “expand” is #TRUE and the property #GtkSeparatorToolItem: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 #GtkToolItem child that has a proxy menu item. To disable this and request enough size for all children, call gtk.toolbar.Toolbar.setShowArrow to set #GtkToolbar:show-arrow to false.

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

CSS nodes

GtkToolbar has a single CSS node with name toolbar.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
Toolbar self() nothrowReturns `this`, for use in `with` statements.
ToolbarGidBuilder builder() static nothrowGet builder for [gtk.toolbar.Toolbar] Returns: New builder object
gtk.types.IconSize iconSize() @property nothrowGet `iconSize` property. Returns: 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.
void iconSize(gtk.types.IconSize propval) @property nothrowSet `iconSize` property. Params: propval = 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.
bool iconSizeSet() @property nothrowGet `iconSizeSet` property. Returns: Is true if the icon-size property has been set.
void iconSizeSet(bool propval) @property nothrowSet `iconSizeSet` property. Params: propval = Is true if the icon-size property has been set.
bool showArrow() @property nothrow
void showArrow(bool propval) @property nothrow
void toolbarStyle(gtk.types.ToolbarStyle propval) @property nothrow
int getDropIndex(int x, int y) nothrowReturns 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.
gtk.types.IconSize getIconSize() nothrowRetrieves the icon size for the toolbar. See [gtk.toolbar.Toolbar.setIconSize]. Returns: the current icon size for the icons on the toolbar.
int getItemIndex(gtk.tool_item.ToolItem item) nothrowReturns the position of item on the toolbar, starting from 0. It is an error if item is not a child of the toolbar.
int getNItems() nothrowReturns the number of items on the toolbar. Returns: the number of items on the toolbar
gtk.tool_item.ToolItem getNthItem(int n) nothrowReturns the `n`'th item on toolbar, or null if the toolbar does not contain an `n`'th item.
gtk.types.ReliefStyle getReliefStyle() nothrowReturns the relief style of buttons on toolbar. See [gtk.button.Button.setRelief]. Returns: The relief style of buttons on toolbar.
bool getShowArrow() nothrowReturns whether the toolbar has an overflow menu. See [gtk.toolbar.Toolbar.setShowArrow]. Returns: true if the toolbar has an overflow menu.
gtk.types.ToolbarStyle getStyle() nothrowRetrieves whether the toolbar has text, icons, or both . See [gtk.toolbar.Toolbar.setStyle]. Returns: the current style of toolbar
void insert(gtk.tool_item.ToolItem item, int pos) nothrowInsert a #GtkToolItem 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.
void setDropHighlightItem(gtk.tool_item.ToolItem toolItem, int index) nothrowHighlights 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 null, highlighting is turned off. In that case index_ is i...
void setIconSize(gtk.types.IconSize iconSize) nothrowThis 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 defa...
void setShowArrow(bool showArrow) nothrowSets 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 [gtk....
void setStyle(gtk.types.ToolbarStyle style) nothrowAlters the view of toolbar to display either icons only, text only, or both.
void unsetIconSize() nothrowUnsets toolbar icon size set with [gtk.toolbar.Toolbar.setIconSize], so that user preferences will be used to determine the icon size.
void unsetStyle() nothrowUnsets a toolbar style set with [gtk.toolbar.Toolbar.setStyle], so that user preferences will be used to determine the toolbar style.
gulong connectFocusHomeOrEnd(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == bool) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == bool))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.toolbar.Toolbar))) && Parameters!T.length < 3) nothrowConnect to `FocusHomeOrEnd` signal.
gulong connectOrientationChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gtk.types.Orientation))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.toolbar.Toolbar))) && Parameters!T.length < 3) nothrowConnect to `OrientationChanged` signal.
gulong connectPopupContextMenu(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == bool) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == int))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == int))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] == int))) && (Parameters!T.length < 4 || (ParameterStorageClassTuple!T[3] == ParameterStorageClass.none && is(Parameters!T[3] : gtk.toolbar.Toolbar))) && Parameters!T.length < 5) nothrowConnect to `PopupContextMenu` signal.
gulong connectStyleChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gtk.types.ToolbarStyle))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.toolbar.Toolbar))) && Parameters!T.length < 3) nothrowConnect to `StyleChanged` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new toolbar. Returns: the newly-created toolbar.

Fluent builder implementation template for gtk.toolbar.Toolbar

Methods
T iconSize(gtk.types.IconSize propval) nothrowSet `iconSize` property. Params: propval = 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.
T iconSizeSet(bool propval) nothrowSet `iconSizeSet` property. Params: propval = Is true if the icon-size property has been set. Returns: Builder instance for fluent chaining
T showArrow(bool propval) nothrow

Fluent builder for gtk.toolbar.Toolbar

Methods
Toolbar build() nothrowCreate object from builder. Returns: New object