Gtk2::ToolButton(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

πŸ’– 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::AtkImplementorIface
  • Gtk2::Buildable
  • Gtk2::Activatable

✨ METHODS ✨

🌟 making one

  • toolitem = Gtk2::ToolButton->new ($icon_widget, $label)

takes these two babes:

  • $icon_widget β€” a Gtk2::Widget, or undef if you're not feeling it
  • $label β€” a string, or undef (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, or undef
Since: gtk+ 2.8

🫢 icon widget vibes

  • widget or undef = $button->get_icon_widget
  • $button->set_icon_widget ($icon_widget)
    • $icon_widget β€” a Gtk2::Widget, or undef

πŸ’¬ label vibes

  • string or undef = $button->get_label
  • $button->set_label ($label)
    • $label β€” a string, or undef

🧚 label widget vibes

  • widget or undef = $button->get_label_widget
  • $button->set_label_widget ($label_widget)
    • $label_widget β€” a Gtk2::Widget, or undef

πŸ‘‘ stock id vibes

  • string = $button->get_stock_id
  • $button->set_stock_id ($stock_id)
    • $stock_id β€” a string, or undef

🌈 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 (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