Gtk2::ToolButton(3)
π Gtk2::ToolButton π
okay bestie, so this is Gtk2::ToolButton β the lil wrapper for GtkToolButton π it's the button you slap in a toolbar, the one with an icon and/or a label on it, and it's so fetch. let's get into it β¨
πΈ HIERARCHY πΈ
the family tree, and yes she comes from a long line of icons π
Glib::Object
+----Glib::InitiallyUnowned
+----Gtk2::Object
+----Gtk2::Widget
+----Gtk2::Container
+----Gtk2::Bin
+----Gtk2::ToolItem
+----Gtk2::ToolButton
π¦ INTERFACES π¦
she's got range, she implements all of these:
Glib::Object::_Unregistered::AtkImplementorIfaceGtk2::BuildableGtk2::Activatable
β¨ METHODS β¨
π making one
toolitem = Gtk2::ToolButton->new ($icon_widget, $label)
takes these two babes:
$icon_widgetβ aGtk2::Widget, orundefif you're not feeling it$labelβ a string, orundef(again, no pressure)
toolitem = Gtk2::ToolButton->new_from_stock ($stock_id)$stock_idβ a string
ngl, stock stuff is old-school Gtk, but she's still here and she still works π
π icon name vibes
string or undef = $button->get_icon_name
Since: gtk+ 2.8
$button->set_icon_name ($icon_name)$icon_nameβ a string, orundef
Since: gtk+ 2.8
π«Ά icon widget vibes
widget or undef = $button->get_icon_widget$button->set_icon_widget ($icon_widget)$icon_widgetβ aGtk2::Widget, orundef
π¬ label vibes
string or undef = $button->get_label$button->set_label ($label)$labelβ a string, orundef
π§ label widget vibes
widget or undef = $button->get_label_widget$button->set_label_widget ($label_widget)$label_widgetβ aGtk2::Widget, orundef
π stock id vibes
string = $button->get_stock_id$button->set_stock_id ($stock_id)$stock_idβ a string, orundef
π underline vibes
boolean = $button->get_use_underline$button->set_use_underline ($use_underline)$use_underlineβ a boolean
π PROPERTIES π
every single one of them, bestie, all readable / writable / private / static-nick / static-blurb:
'icon-name'(string : default undef : readable / writable / private / static-nick / static-blurb) β the name of the themed icon displayed on the item π'icon-widget'(Gtk2::Widget : default undef : readable / writable / private / static-nick / static-blurb) β icon widget to display in the item'label'(string : default undef : readable / writable / private / static-nick / static-blurb) β text to show in the item.'label-widget'(Gtk2::Widget : default undef : readable / writable / private / static-nick / static-blurb) β widget to use as the item label'stock-id'(string : default undef : readable / writable / private / static-nick / static-blurb) β the stock icon displayed on the item'use-underline'(boolean : default false : readable / writable / private / static-nick / static-blurb) β if set, an underline in the label property indicates that the next character should be used for the mnemonic accelerator key in the overflow menu π«Ά
πΈ STYLE PROPERTIES πΈ
'icon-spacing'(integer : default 3 : readable / writable / private / static-nick / static-blurb) β spacing in pixels between the icon and label π
π₯ SIGNALS π₯
clicked(Gtk2::ToolButton)
the moment she gets clicked, she's the main character, no cap β¨
π SEE ALSO π
go read these next, iykyk:
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::Bin, Gtk2::ToolItem
π 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 page, bestie π«Ά she's from perl v5.42.0, dated 2025-07-25, and she ate, periodt πβ¨π
π¦ 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