Gtk2::AccelLabel(3)
π 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::AtkImplementorIfaceGtk2::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:
Gtk2Glib::ObjectGlib::InitiallyUnownedGtk2::ObjectGtk2::WidgetGtk2::MiscGtk2::Label
π COPYRIGHT π
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
- 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