Gtk2::AccelLabel(3)

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

πŸ’– Gtk2::AccelLabel β€” the wrapper for GtkAccelLabel, bestie πŸ’–

okay so real talk, this is the Perl-side glow-up of GtkAccelLabel from the gtk2-perl crew. It's a label that also knows about your keyboard shortcuts, and she is serving.


🚨 NAME 🚨

Gtk2::AccelLabel β€” literally just a wrapper for GtkAccelLabel. That's it. That's the whole vibe. πŸŽ€


✨ DESCRIPTION ✨

okay so before you go feral with this one, hear me out, because there's a lil gotcha and it's giving circular reference energy:

The accel-widget property is a hard reference to the target widget. Not a soft lil situationship. A HARD one. πŸ’€

So if that target widget happens to be a container parent of the AccelLabel? boom, you've got yourself a circular reference, and you're gonna have to unset it yourself with an explicit destroy when you don't want it anymore. That's just how it goes with these things, no cap.

If you wanna see how this plays out in the common case β€” a MenuItem that contains an AccelLabel β€” go peek at Gtk2::MenuItem. It's all explained there, bestie. 🫢


🌈 HIERARCHY 🌈

look at her lineage. iconic family tree honestly. πŸ‘‘

  Glib::Object
  +----Glib::InitiallyUnowned
       +----Gtk2::Object
            +----Gtk2::Widget
                 +----Gtk2::Misc
                      +----Gtk2::Label
                           +----Gtk2::AccelLabel

πŸ¦‹ INTERFACES πŸ¦‹

the girlies she's affiliated with:

  • Glib::Object::_Unregistered::AtkImplementorIface
  • Gtk2::Buildable

πŸ’… METHODS πŸ’…

🌸 widget = Gtk2::AccelLabel->new ($string)

make a brand new one, slay. here's what you hand her:

  • $string (string) β€” the text, obviously πŸ’–

🌸 widget or undef = $accel_label->get_accel_widget

🌸 $accel_label->set_accel_widget ($accel_widget)

getter and setter, the classic duo. and the arg:

  • $accel_widget (Gtk2::Widget or undef) β€” the widget in question, or literally nothing, your call ✨

🌸 integer = $accel_label->get_accel_width

hands you back an integer. that's the width, periodt.

🌸 boolean = $accel_label->refetch

gives you a boolean back. go off. πŸ”₯


πŸŽ€ PROPERTIES πŸŽ€

  • 'accel-closure' (GClosure : default undef : readable / writable / private / static-nick / static-blurb) β€” the closure that gets monitored for accelerator changes. she's watching πŸ‘€
  • 'accel-widget' (Gtk2::Widget : default undef : readable / writable / private / static-nick / static-blurb) β€” the widget that gets monitored for accelerator changes. also being watched πŸ‘€

πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group, go say hi:

  • Gtk2
  • Glib::Object
  • Glib::InitiallyUnowned
  • Gtk2::Object
  • Gtk2::Widget
  • Gtk2::Misc
  • Gtk2::Label

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL. See Gtk2 for a full notice. 🫢


okay that's the whole page bestie, ty for coming to my ted talk πŸ’–βœ¨

mwah πŸ’‹ this was documented with perl v5.42.0, dated 2025-07-25 β€” and yes, that's the Gtk2::AccelLabel(3) page, the one and only. periodt. πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from