ToolItem

Description GtkToolItems are widgets that can appear on a toolbar. To create a toolbar item that contain something else than a button, use gtk_tool_item_new(). Use gtk_container_add() to add a child widget to the tool item. For toolbar items that contain buttons, see the GtkToolButton, GtkToggleToolButton and GtkRadioToolButton classes. See the GtkToolbar class for a description of the toolbar widget, and GtkToolShell for a description of the tool shell interface.

class ToolItem : Bin , ActivatableIF {}

Constructors

this
this(GtkToolItem* gtkToolItem)

Sets our main struct and passes it to the parent class

this
this()

Creates a new GtkToolItem Since 2.4

Members

Functions

addOnCreateMenuProxy
void 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 call gtk_tool_item_set_proxy_menu_item() with a NULL pointer and return TRUE to indicate that the item should not appear in the overflow menu call gtk_tool_item_set_proxy_menu_item() with a new menu item and return TRUE, or return FALSE to indicate that the signal was not handled by the item. This means that the item will not appear in the overflow menu unless a later handler installs a menu item. The toolbar may cache the result of this signal. When the tool item changes how it will respond to this signal it must call gtk_tool_item_rebuild_menu() to invalidate the cache and ensure that the toolbar rebuilds its overflow menu. TRUE if the signal was handled, FALSE if not

addOnSetTooltip
void addOnSetTooltip(bool delegate(Tooltips, string, string, ToolItem) dlg, ConnectFlags connectFlags)

Warning GtkToolItem::set-tooltip has been deprecated since version 2.12 and should not be used in newly-written code. With the new tooltip API, there is no need to use this signal anymore. This signal is emitted when the toolitem's tooltip changes. Application developers can use gtk_tool_item_set_tooltip() to set the item's tooltip. TRUE if the signal was handled, FALSE if not

addOnToolbarReconfigured
void 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 GtkToolItem, 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. See Also GtkToolbar The toolbar widget GtkToolButton A subclass of GtkToolItem that displays buttons on the toolbar GtkSeparatorToolItem A subclass of GtkToolItem that separates groups of items on a toolbar

getEllipsizeMode
PangoEllipsizeMode getEllipsizeMode()

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

getExpand
int getExpand()

Returns whether tool_item is allocated extra space. See gtk_tool_item_set_expand(). Since 2.4

getHomogeneous
int getHomogeneous()

Returns whether tool_item is the same size as other homogeneous items. See gtk_tool_item_set_homogeneous(). Since 2.4

getIconSize
GtkIconSize getIconSize()

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

getIsImportant
int getIsImportant()

Returns whether tool_item is considered important. See gtk_tool_item_set_is_important() Since 2.4

getOrientation
GtkOrientation getOrientation()

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

getProxyMenuItem
Widget getProxyMenuItem(string menuItemId)

If menu_item_id matches the string passed to gtk_tool_item_set_proxy_menu_item() return the corresponding GtkMenuItem. Custom subclasses of GtkToolItem should use this function to update their menu item when the GtkToolItem changes. That the menu_item_ids must match ensures that a GtkToolItem will not inadvertently change a menu item that they did not create. Since 2.4

getReliefStyle
GtkReliefStyle getReliefStyle()

Returns the relief style of tool_item. See gtk_button_set_relief_style(). Custom subclasses of GtkToolItem should call this function in the handler of the "toolbar_reconfigured" signal to find out the relief style of buttons. Since 2.4

getStruct
void* getStruct()

the main Gtk struct as a void*

getTextAlignment
float getTextAlignment()

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

getTextOrientation
GtkOrientation getTextOrientation()

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

getTextSizeGroup
SizeGroup getTextSizeGroup()

Returns the size group used for labels in tool_item. Custom subclasses of GtkToolItem should call this function and use the size group for labels. Since 2.20

getToolItemStruct
GtkToolItem* getToolItemStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getToolbarStyle
GtkToolbarStyle getToolbarStyle()

Returns the toolbar style used for tool_item. Custom subclasses of GtkToolItem 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 Since 2.4

getUseDragWindow
int getUseDragWindow()

Returns whether tool_item has a drag window. See gtk_tool_item_set_use_drag_window(). Since 2.4

getVisibleHorizontal
int getVisibleHorizontal()

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

getVisibleVertical
int getVisibleVertical()

Returns whether tool_item is visible when the toolbar is docked vertically. See gtk_tool_item_set_visible_vertical(). Since 2.4

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. The function must be called when the tool item changes what it will do in response to the "create-menu-proxy" signal. Since 2.6

retrieveProxyMenuItem
Widget retrieveProxyMenuItem()

Returns the GtkMenuItem that was last set by gtk_tool_item_set_proxy_menu_item(), ie. the GtkMenuItem that is going to appear in the overflow menu. Since 2.4

setExpand
void setExpand(int 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. Since 2.4

setHomogeneous
void setHomogeneous(int 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. Since 2.4

setIsImportant
void setIsImportant(int isImportant)

Sets whether tool_item should be considered important. The GtkToolButton 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" Since 2.4

setProxyMenuItem
void setProxyMenuItem(string menuItemId, Widget menuItem)

Sets the GtkMenuItem 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 gtk_tool_item_get_proxy_menu_item(). Since 2.4

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
setTooltip
void setTooltip(string tipText, string tipPrivate)

Sets this widget tooltip

setTooltip
void setTooltip(Tooltips tooltips, string tipText, string tipPrivate)

Warning gtk_tool_item_set_tooltip has been deprecated since version 2.12 and should not be used in newly-written code. Use gtk_tool_item_set_tooltip_text() instead. Sets the GtkTooltips object to be used for tool_item, the text to be displayed as tooltip on the item and the private text to be used. See gtk_tooltips_set_tip(). Since 2.4

setTooltipMarkup
void setTooltipMarkup(string markup)

Sets the markup text to be displayed as tooltip on the item. See gtk_widget_set_tooltip_markup(). Since 2.12

setTooltipText
void setTooltipText(string text)

Sets the text to be displayed as tooltip on the item. See gtk_widget_set_tooltip_text(). Since 2.12

setUseDragWindow
void setUseDragWindow(int 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. Since 2.4

setVisibleHorizontal
void setVisibleHorizontal(int visibleHorizontal)

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

setVisibleVertical
void setVisibleVertical(int 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. Since 2.4

toolbarReconfigured
void toolbarReconfigured()

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

Mixins

__anonymous
mixin ActivatableT!(GtkToolItem)
Undocumented in source.

Static functions

callBackCreateMenuProxy
gboolean callBackCreateMenuProxy(GtkToolItem* toolItemStruct, ToolItem _toolItem)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackSetTooltip
gboolean callBackSetTooltip(GtkToolItem* toolItemStruct, GtkTooltips* tooltips, gchar* tipText, gchar* tipPrivate, ToolItem _toolItem)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackToolbarReconfigured
void callBackToolbarReconfigured(GtkToolItem* toolItemStruct, ToolItem _toolItem)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

connectedSignals
int[string] connectedSignals;
gtkToolItem
GtkToolItem* gtkToolItem;

the main Gtk struct

onCreateMenuProxyListeners
bool delegate(ToolItem)[] onCreateMenuProxyListeners;
Undocumented in source.
onSetTooltipListeners
bool delegate(Tooltips, string, string, ToolItem)[] onSetTooltipListeners;
Undocumented in source.
onToolbarReconfiguredListeners
void delegate(ToolItem)[] onToolbarReconfiguredListeners;
Undocumented in source.

Inherited Members

From Bin

gtkBin
GtkBin* gtkBin;

the main Gtk struct

getBinStruct
GtkBin* getBinStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
getChild
Widget getChild()

Gets the child of the GtkBin, 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

getActivatableTStruct
GtkActivatable* getActivatableTStruct()
Undocumented in source.
getStruct
void* getStruct()

the main Gtk struct as a void*

doSetRelatedAction
void doSetRelatedAction(Action action)

This is a utility function for GtkActivatable implementors. When implementing GtkActivatable you must call this when handling changes of the "related-action", and you must also use this to break references in GObject->dispose(). This function adds a reference to the currently set related action for you, it also makes sure the GtkActivatable->update() method is called when the related GtkAction properties change and registers to the action's proxy list. Note Be careful to call this before setting the local copy of the GtkAction property, since this function uses gtk_activatable_get_action() to retrieve the previous action Since 2.16

getRelatedAction
Action getRelatedAction()

Gets the related GtkAction for activatable. Since 2.16

getUseActionAppearance
int getUseActionAppearance()

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

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. Since 2.16

setRelatedAction
void setRelatedAction(Action action)

Sets the related action on the activatable object. Note GtkActivatable implementors need to handle the "related-action" property and call gtk_activatable_do_set_related_action() when it changes. Since 2.16

setUseActionAppearance
void setUseActionAppearance(int useAppearance)

Sets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance Note GtkActivatable implementors need to handle the "use-action-appearance" property and call gtk_activatable_sync_action_properties() to update activatable if needed. Since 2.16

Meta