11.128Class GtkToolbar

Create bars of buttons and other widgets

Class GtkToolbar

A toolbar can contain instances of a subclass of GtkToolItem. To add a GtkToolItem to the a toolbar, use gtk_toolbar_insert(). To remove an item from the toolbar use gtk_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 a GtkSeparatorToolItem has the "expand" property set to TRUE and the "draw" property 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 "popup-context-menu" signal.

Methods
get_drop_indexReturns the position corresponding to the indicated point on toolbar.
get_icon_sizeRetrieves the icon size for the toolbar.
get_item_indexReturns the position of item on the toolbar, starting from 0.
get_n_itemsReturns the number of items on the toolbar.
get_nth_itemReturns the n'th item on toolbar, or NULL if the toolbar does not contain an n'th item.
get_relief_styleReturns the relief style of buttons on toolbar.
get_show_arrowReturns whether the toolbar has an overflow menu.
get_styleRetrieves whether the toolbar has text, icons, or both.
insertInsert a GtkToolItem into the toolbar at position pos.
set_drop_highlight_itemHighlights toolbar to give an idea of what it would look like if item was added to toolbar at the position indicated by index_.
set_icon_sizeThis function sets the size of stock icons in the toolbar.
set_show_arrowSets whether to show an overflow menu when toolbar doesn't have room for all items on it.
set_styleAlters the view of toolbar to display either icons only, text only, or both.
signal_orientation_changedEmitted when the orientation of the toolbar changes.
signal_popup_context_menuEmitted when the user right-clicks the toolbar or uses the keybinding to display a popup menu.
signal_style_changedEmitted when the style of the toolbar changes.
unset_icon_sizeUnsets toolbar icon size set with gtk_toolbar_set_icon_size(), so that user preferences will be used to determine the icon size.
unset_styleUnsets a toolbar style set with gtk_toolbar_set_style(), so that user preferences will be used to determine the toolbar style.

Methods

get_drop_index

Returns the position corresponding to the indicated point on toolbar.

GtkToolbar.get_drop_index( x, y )
x x coordinate of a point on the toolbar
y y coordinate of a point on the toolbar
ReturnThe position corresponding to the point (x, y) on the 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.

get_icon_size

Retrieves the icon size for the toolbar.

GtkToolbar.get_icon_size()
Returnthe current icon size for the icons on the toolbar (GtkIconSize).

get_item_index

Returns the position of item on the toolbar, starting from 0.

GtkToolbar.get_item_index( item )
item a GtkToolItem that is a child of toolbar
ReturnThe position of item on the toolbar

It is an error if item is not a child of the toolbar.

get_n_items

Returns the number of items on the toolbar.

GtkToolbar.get_n_items()
Returnthe number of items on the toolbar

get_nth_item

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

GtkToolbar.get_nth_item()

get_relief_style

Returns the relief style of buttons on toolbar.

GtkToolbar.get_relief_style()
ReturnThe relief style of buttons on toolbar (GtkReliefStyle).

get_show_arrow

Returns whether the toolbar has an overflow menu.

GtkToolbar.get_show_arrow()
ReturnTRUE if the toolbar has an overflow menu.

get_style

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

GtkToolbar.get_style()
Returnthe current style of toolbar (GtkToolbarStyle).

insert

Insert a GtkToolItem into the toolbar at position pos.

GtkToolbar.insert( item, pos )
item a GtkToolItem
pos the position of the new item

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.

set_drop_highlight_item

Highlights toolbar to give an idea of what it would look like if item was added to toolbar at the position indicated by index_.

GtkToolbar.set_drop_highlight_item( tool_item, index )
tool_item a GtkToolItem, or nil to turn of highlighting.
index a position on toolbar

If item is nil, highlighting is turned off. In that case index_ is ignored.

The tool_item 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.

set_icon_size

This function sets the size of stock icons in the toolbar.

GtkToolbar.set_icon_size( icon_size )
icon_size The GtkIconSize that stock icons in the toolbar shall have

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.

set_show_arrow

Sets whether to show an overflow menu when toolbar doesn't have room for all items on it.

GtkToolbar.set_show_arrow( show_arrow )
show_arrow Whether to show an overflow menu

If TRUE, items that there are not room are available through an overflow menu.

set_style

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

GtkToolbar.set_style( style )
style the new style for toolbar (GtkToolbarStyle).

signal_orientation_changed

Emitted when the orientation of the toolbar changes.

GtkToolbar.signal_orientation_changed()

signal_popup_context_menu

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

GtkToolbar.signal_popup_context_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.

signal_style_changed

Emitted when the style of the toolbar changes.

GtkToolbar.signal_style_changed()

unset_icon_size

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

GtkToolbar.unset_icon_size()

unset_style

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

GtkToolbar.unset_style()
Made with http://www.falconpl.org