Gtk2::ToolItem(3)
π Gtk2::ToolItem β the manual, but make it make sense π
okay so bestie, welcome to Gtk2::ToolItem β¨ this is the Perl wrapper for GtkToolItem β the little base-class baddie that every toolbar thingy (buttons, separators, whatever) is built on top of. she's the blueprint, the template, the main character that other tool items inherit their whole vibe from π
πΈ HIERARCHY πΈ
so the family tree is giving royalty, and here's exactly how she descends:
Glib::Object
+----Glib::InitiallyUnowned
+----Gtk2::Object
+----Gtk2::Widget
+----Gtk2::Container
+----Gtk2::Bin
+----Gtk2::ToolItem
like, she's deep in the lineage, but she knows exactly who she is π
π¦ INTERFACES π¦
these are the interfaces she implements, no cap:
Glib::Object::_Unregistered::AtkImplementorIfaceGtk2::BuildableGtk2::Activatable
β¨ METHODS β¨
π«Ά the constructor
toolitem = Gtk2::ToolItem->new
make a fresh one. brand new tool item, fresh out the box, ready to be put on a toolbar. slay.
π ellipsize mode
ellipsizemode = $tool_item->get_ellipsize_mode
grab her ellipsize mode. lowkey only here if you're on a new enough GTK.
Since: gtk+ 2.20
π« expand
boolean = $tool_item->get_expand
$tool_item->set_expand ($expand)
$expand(boolean) β true/false, do you want her expanding or not
read it, set it, whatever you need bestie.
π homogeneous
boolean = $tool_item->get_homogeneous
$tool_item->set_homogeneous ($homogeneous)
$homogeneous(boolean) β boolean in, boolean energy out
π icon size
iconsize = $tool_item->get_icon_size
returns the icon size. that's it, that's the method. iconic.
π₯ is it important tho
boolean = $tool_item->get_is_important
$tool_item->set_is_important ($is_important)
$is_important(boolean) β set it true and she's IMPORTANT, okay?
π orientation
orientation = $tool_item->get_orientation
which way is she facing? get the orientation and find out.
π proxy menu items
widget = $tool_item->get_proxy_menu_item ($menu_item_id)
$menu_item_id(string) β the id you're looking up
hands you back the widget for that menu item id.
$tool_item->set_proxy_menu_item ($menu_item_id, $menu_item)
$menu_item_id(string)$menu_item(Gtk2::Widgetorundef)
set the proxy menu item β and yes, undef is allowed, no judgement π«Ά
πΈ rebuild that menu
$tool_item->rebuild_menu
Since: gtk+ 2.6
β relief style
reliefstyle = $tool_item->get_relief_style
returns the relief style. very chill, very calm, very demure.
π§ retrieve the proxy menu item
widget = $tool_item->retrieve_proxy_menu_item
gives you the widget back. no arguments, just vibes.
π text alignment
double = $tool_item->get_text_alignment
Since: gtk+ 2.20
returns a double, so precise bestie β¨
π text orientation
orientation = $tool_item->get_text_orientation
Since: gtk+ 2.20
π text size group
sizegroup = $tool_item->get_text_size_group
Since: gtk+ 2.20
π₯ toolbar reconfigured
$tool_item->toolbar_reconfigured
Since: gtk+ 2.14
something changed on the toolbar and she needs to know. this is her little heads-up.
π toolbar style
toolbarstyle = $tool_item->get_toolbar_style
returns the style of the toolbar. periodt.
π¦ tooltips, the markup way
$tool_item->set_tooltip_markup ($markup)
$markup(string or undef)
Since: gtk+ 2.12
yes undef is fine, no cap.
π tooltips, the old-school way
$tool_item->set_tooltip ($tooltips, $tip_text, $tip_private)
$tooltips(Gtk2::Tooltips)$tip_text(string)$tip_private(string)
the classic trio. we love a legacy moment π
π tooltips, the plain text way
$tool_item->set_tooltip_text ($text)
$text(string or undef)
Since: gtk+ 2.12
πΈ use drag window
boolean = $toolitem->get_use_drag_window
$toolitem->set_use_drag_window ($use_drag_window)
$use_drag_window(boolean)
note: these ones are written$toolitemnot$tool_itemβ that's literally how the page has it, and we're keeping it exactly as-is, iykyk π
β visible horizontal
boolean = $toolitem->get_visible_horizontal
$toolitem->set_visible_horizontal ($visible_horizontal)
$visible_horizontal(boolean)
π visible vertical
boolean = $toolitem->get_visible_vertical
$toolitem->set_visible_vertical ($visible_vertical)
$visible_vertical(boolean)
π PROPERTIES π
'is-important' β boolean : default false : readable / writable / private / static-nick / static-blurb
whether the toolbar item is considered important. when TRUE, toolbar buttons show text in GTK_TOOLBAR_BOTH_HORIZ mode. so yeah, flipping this actually changes the drip β¨
'visible-horizontal' β boolean : default true : readable / writable / private / static-nick / static-blurb
whether the toolbar item is visible when the toolbar is in a horizontal orientation.
'visible-vertical' β boolean : default true : readable / writable / private / static-nick / static-blurb
whether the toolbar item is visible when the toolbar is in a vertical orientation.
π SIGNALS π
boolean = create-menu-proxy (Gtk2::ToolItem)boolean = set-tooltip (Gtk2::ToolItem, Gtk2::Tooltips, string, string)toolbar-reconfigured (Gtk2::ToolItem)
π¦ ENUMS AND FLAGS π¦
enum Gtk2::IconSize
'invalid'/GTK_ICON_SIZE_INVALID'menu'/GTK_ICON_SIZE_MENU'small-toolbar'/GTK_ICON_SIZE_SMALL_TOOLBAR'large-toolbar'/GTK_ICON_SIZE_LARGE_TOOLBAR'button'/GTK_ICON_SIZE_BUTTON'dnd'/GTK_ICON_SIZE_DND'dialog'/GTK_ICON_SIZE_DIALOG
enum Gtk2::Orientation
'horizontal'/GTK_ORIENTATION_HORIZONTAL'vertical'/GTK_ORIENTATION_VERTICAL
enum Gtk2::ReliefStyle
'normal'/GTK_RELIEF_NORMAL'half'/GTK_RELIEF_HALF'none'/GTK_RELIEF_NONE
enum Gtk2::ToolbarStyle
'icons'/GTK_TOOLBAR_ICONS'text'/GTK_TOOLBAR_TEXT'both'/GTK_TOOLBAR_BOTH'both-horiz'/GTK_TOOLBAR_BOTH_HORIZ
enum Pango::EllipsizeMode
'none'/PANGO_ELLIPSIZE_NONE'start'/PANGO_ELLIPSIZE_START'middle'/PANGO_ELLIPSIZE_MIDDLE'end'/PANGO_ELLIPSIZE_END
π SEE ALSO π
go read these next, they're all connected bestie:
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::Bin
π COPYRIGHT π
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.
and that's the whole thing, you ate it up fr fr π«Ά this was written by the gtk2-perl girlies back in the day β the page itself is from perl v5.42.0, dated 2025-07-25, filed under Gtk2::ToolItem(3). go build something iconic with it πβ¨
π¦ where this page comes from
- fedora 43: perl-Gtk2 1.24993-23.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms