Package: gtk

Class gtk-toolbar

Superclasses

Documented Subclasses

None

Direct Slots

icon-size
The icon-size property of type :int (Read / Write)
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.
Allowed values: >= 0
Default value: 3
icon-size-set
The icon-size-set property of type :boolean (Read / Write)
Is true if the icon-size property has been set.
Default value: nil
show-arrow
The show-arrow property of type :boolean (Read / Write)
If an arrow should be shown if the toolbar does not fit.
Default value: true
toolbar-style
The toolbar-style property of type gtk-toolbar-style (Read / Write)
How to draw the toolbar.
Default value: :both

Details

A toolbar can contain instances of a subclass of gtk-tool-item. A toolbar is created with a call to the gtk-toolbar-new function. To add a gtk-tool-item widget to the toolbar, use the gtk-toolbar-insert function. To remove an item from the toolbar use the gtk-container-remove function. To add a button to the toolbar, add an instance of the gtk-tool-button class.

Toolbar items can be visually grouped by adding instances of the gtk-separator-tool-item class to the toolbar. If the gtk-toolbar child property expand is true and the property draw is set to nil, 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 "popup-context-menu" signal.

CSS nodes

The gtk-toolbar class has a single CSS node with name toolbar.

Child Property Details

expand
The expand child property of type :boolean (Read / Write)
Whether the item should receive extra space when the toolbar grows.
Default value: nil
homogeneous
The homogeneous child property of type :boolean (Read / Write)
Whether the item should be the same size as other homogeneous items.
Default value: nil

Style Property Details

button-relief
The button-relief style property of type gtk-relief-style (Read)
Type of bevel around toolbar buttons.
Default value: :none
internal-padding
The internal-padding style property of type :int (Read)
Amount of border space between the toolbar shadow and the buttons.
Warning: internal-padding has been deprecated since version 3.6 and should not be used in newly-written code. Use the standard padding CSS property, through objects like gtk-style-context and gtk-css-provider; the value of this style property is ignored.
Allowed values: >= 0
Default value: 0
max-child-expand
The max-child-expand style property of type :int (Read)
Maximum amount of space an expandable item will be given.
Allowed values: >= 0
Default value: 2147483647
shadow-type
The shadow-type style property of type gtk-shadow-type (Read)
Style of bevel around the toolbar.
Warning: shadow-type has been deprecated since version 3.6 and should not be used in newly-written code. Use the standard border CSS property, through objects like gtk-style-context and gtk-css-provider; the value of this style property is ignored.
Default value: :out
space-size
The space-size style property of type :int (Read)
Size of spacers.
Warning: space-size has been deprecated since version 3.20 and should not be used in newly-written code. Use the standard margin/padding CSS properties on the separator elements; the value of this style property is ignored.
Allowed values: >= 0
Default value: 12
space-style
The space-style style property of type gtk-toolbar-space-style (Read)
Whether spacers are vertical lines or just blank.
Warning: space-style has been deprecated since version 3.20 and should not be used in newly-written code. Use CSS properties on the separator elements to style toolbar spacers; the value of this style property is ignored.
Default value: :line

Signal Details

The "focus-home-or-end" signal
 lambda (toolbar focus-home)    : Action      
A keybinding signal used internally by GTK+. This signal cannot be used in application code.
toolbar
The gtk-toolbar which emitted the signal.
focus-home
True if the first item should be focused.
Returns
True if the signal was handled, nil if not.
The "orientation-changed" signal
 lambda (toolbar orientation)    : Run First      
Emitted when the orientation of the toolbar changes.
toolbar
The object which emitted the signal.
orientation
The new gtk-orientation of the toolbar.
The "popup-context-menu" signal
 lambda (toolbar x y button)    : Run Last      
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.
toolbar
The gtk-toolbar which emitted the signal.
x
The x coordinate of the point where the menu should appear.
y
The y coordinate of the point where the menu should appear.
button
The mouse button the user pressed, or -1.
Returns
Return true if the signal was handled, nil if not.
The "style-changed" signal
 lambda (toolbar style)    : Run First      
Emitted when the style of the toolbar changes.
toolbar
The gtk-toolbar which emitted the signal.
style
The new gtk-toolbar-style of the toolbar.
 

Slot Access Functions

Inherited Slot Access Functions

See also

2014-1-26