ToolItem

gtk.ToolItems are widgets that can appear on a toolbar. To create a toolbar item that contain something else than a button, use ToolItem.new. Use Container.add to add a child widget to the tool item.

For toolbar items that contain buttons, see the gtk.ToolButton, gtk.ToggleToolButton and gtk.RadioToolButton classes.

See the gtk.Toolbar class for a description of the toolbar widget, and GtkToolShell for a description of the tool shell interface.

Constructors

this
this(GtkToolItem* gtkToolItem, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new gtk.ToolItem

Members

Functions

addOnCreateMenuProxy
gulong addOnCreateMenuProxy(bool delegate(ToolItem) dlg, ConnectFlags connectFlags)

This signal is emitted when the toolbar needs information from tool_item about whether the item should appear in the toolbar overflow menu. In response the tool item should either

addOnToolbarReconfigured
gulong addOnToolbarReconfigured(void delegate(ToolItem) dlg, ConnectFlags connectFlags)

This signal is emitted when some property of the toolbar that the item is a child of changes. For custom subclasses of gtk.ToolItem, the default handler of this signal use the functions - gtk_tool_shell_get_orientation() - gtk_tool_shell_get_style() - gtk_tool_shell_get_icon_size() - gtk_tool_shell_get_relief_style() to find out what the toolbar should look like and change themselves accordingly.

getEllipsizeMode
PangoEllipsizeMode getEllipsizeMode()

Returns the ellipsize mode used for tool_item. Custom subclasses of gtk.ToolItem should call this function to find out how text should be ellipsized.

getExpand
bool getExpand()

Returns whether tool_item is allocated extra space. See ToolItem.setExpand.

getHomogeneous
bool getHomogeneous()

Returns whether tool_item is the same size as other homogeneous items. See ToolItem.setHomogeneous.

getIconSize
GtkIconSize getIconSize()

Returns the icon size used for tool_item. Custom subclasses of gtk.ToolItem should call this function to find out what size icons they should use.

getIsImportant
bool getIsImportant()

Returns whether tool_item is considered important. See ToolItem.setIsImportant

getOrientation
GtkOrientation getOrientation()

Returns the orientation used for tool_item. Custom subclasses of gtk.ToolItem should call this function to find out what size icons they should use.

getProxyMenuItem
Widget getProxyMenuItem(string menuItemId)

If menu_item_id matches the string passed to ToolItem.setProxyMenuItem return the corresponding gtk.MenuItem

getReliefStyle
GtkReliefStyle getReliefStyle()

Returns the relief style of tool_item. See Button.setRelief. Custom subclasses of gtk.ToolItem should call this function in the handler of the toolbar_reconfigured signal to find out the relief style of buttons.

getStruct
void* getStruct()

the main Gtk struct as a void*

getTextAlignment
float getTextAlignment()

Returns the text alignment used for tool_item. Custom subclasses of gtk.ToolItem should call this function to find out how text should be aligned.

getTextOrientation
GtkOrientation getTextOrientation()

Returns the text orientation used for tool_item. Custom subclasses of gtk.ToolItem should call this function to find out how text should be orientated.

getTextSizeGroup
SizeGroup getTextSizeGroup()

Returns the size group used for labels in tool_item. Custom subclasses of gtk.ToolItem should call this function and use the size group for labels.

getToolItemStruct
GtkToolItem* getToolItemStruct(bool transferOwnership)

Get the main Gtk struct

getToolbarStyle
GtkToolbarStyle getToolbarStyle()

Returns the toolbar style used for tool_item. Custom subclasses of gtk.ToolItem should call this function in the handler of the GtkToolItem::toolbar_reconfigured signal to find out in what style the toolbar is displayed and change themselves accordingly

getUseDragWindow
bool getUseDragWindow()

Returns whether tool_item has a drag window. See ToolItem.setUseDragWindow.

getVisibleHorizontal
bool getVisibleHorizontal()

Returns whether the tool_item is visible on toolbars that are docked horizontally.

getVisibleVertical
bool getVisibleVertical()

Returns whether tool_item is visible when the toolbar is docked vertically. See ToolItem.setVisibleVertical.

rebuildMenu
void rebuildMenu()

Calling this function signals to the toolbar that the overflow menu item for tool_item has changed. If the overflow menu is visible when this function it called, the menu will be rebuilt.

retrieveProxyMenuItem
Widget retrieveProxyMenuItem()

Returns the gtk.MenuItem that was last set by ToolItem.setProxyMenuItem, ie. the gtk.MenuItem that is going to appear in the overflow menu.

setExpand
void setExpand(bool expand)

Sets whether tool_item is allocated extra space when there is more room on the toolbar then needed for the items. The effect is that the item gets bigger when the toolbar gets bigger and smaller when the toolbar gets smaller.

setHomogeneous
void setHomogeneous(bool homogeneous)

Sets whether tool_item is to be allocated the same size as other homogeneous items. The effect is that all homogeneous items will have the same width as the widest of the items.

setIsImportant
void setIsImportant(bool isImportant)

Sets whether tool_item should be considered important. The gtk.ToolButton class uses this property to determine whether to show or hide its label when the toolbar style is GTK_TOOLBAR_BOTH_HORIZ. The result is that only tool buttons with the “is_important” property set have labels, an effect known as “priority text”

setProxyMenuItem
void setProxyMenuItem(string menuItemId, Widget menuItem)

Sets the gtk.MenuItem used in the toolbar overflow menu. The menu_item_id is used to identify the caller of this function and should also be used with ToolItem.getProxyMenuItem.

setTooltipMarkup
void setTooltipMarkup(string markup)

Sets the markup text to be displayed as tooltip on the item. See Widget.setTooltipMarkup.

setTooltipText
void setTooltipText(string text)

Sets the text to be displayed as tooltip on the item. See Widget.setTooltipText.

setUseDragWindow
void setUseDragWindow(bool useDragWindow)

Sets whether tool_item has a drag window. When TRUE the toolitem can be used as a drag source through gtk_drag_source_set(). When tool_item has a drag window it will intercept all events, even those that would otherwise be sent to a child of tool_item.

setVisibleHorizontal
void setVisibleHorizontal(bool visibleHorizontal)

Sets whether tool_item is visible when the toolbar is docked horizontally.

setVisibleVertical
void setVisibleVertical(bool visibleVertical)

Sets whether tool_item is visible when the toolbar is docked vertically. Some tool items, such as text entries, are too wide to be useful on a vertically docked toolbar. If visible_vertical is FALSE tool_item will not appear on toolbars that are docked vertically.

toolbarReconfigured
void toolbarReconfigured()

Emits the signal toolbar_reconfigured on tool_item. gtk.Toolbar and other GtkToolShell implementations use this function to notify children, when some aspect of their configuration changes.

Static functions

getType
GType getType()

Variables

gtkToolItem
GtkToolItem* gtkToolItem;

the main Gtk struct

Inherited Members

From Bin

gtkBin
GtkBin* gtkBin;

the main Gtk struct

getBinStruct
GtkBin* getBinStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
getChild
Widget getChild()

Gets the child of the gtk.Bin, or NULL if the bin contains no child widget. The returned widget does not have a reference added, so you do not need to unref it.

From ActivatableIF

getActivatableStruct
GtkActivatable* getActivatableStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
doSetRelatedAction
void doSetRelatedAction(Action action)

This is a utility function for GtkActivatable implementors.

getRelatedAction
Action getRelatedAction()

Gets the related gtk.Action for activatable.

getUseActionAppearance
bool getUseActionAppearance()

Gets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance.

setRelatedAction
void setRelatedAction(Action action)

Sets the related action on the activatable object.

setUseActionAppearance
void setUseActionAppearance(bool useAppearance)

Sets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance

syncActionProperties
void syncActionProperties(Action action)

This is called to update the activatable completely, this is called internally when the related-action property is set or unset and by the implementing class when use-action-appearance changes.