Gtk2::OptionMenu(3)
π Gtk2::OptionMenu β ok bestie, sit down, we need to talk π
So this is Gtk2::OptionMenu, the Perl wrapper for GtkOptionMenu. It's giving "your older cousin's widget" β iconic in its day, and nowβ¦ well. Keep reading. π
πΈ HIERARCHY πΈ
Here's the family tree, and yes she comes from a long line of ancestors:
Glib::Object
+----Glib::InitiallyUnowned
+----Gtk2::Object
+----Gtk2::Widget
+----Gtk2::Container
+----Gtk2::Bin
+----Gtk2::Button
+----Gtk2::OptionMenu
Six levels deep just to get a dropdown, the way that Gtk2 does. Periodt. π
β¨ INTERFACES β¨
She also collects these like friendship bracelets:
Glib::Object::_Unregistered::AtkImplementorIface
Gtk2::Buildable
Gtk2::Activatable
π DEPRECATION WARNING π
Gtk2::OptionMenu has been marked as deprecated, and should not be used in newly written code.
Not me being the bearer of bad news π β but fr fr, do not build new stuff on this one.
The glow-up you actually want is Gtk2::ComboBox. Use that instead of Gtk2::OptionMenu. That's the whole vibe check. π«Ά
π METHODS π
widget = Gtk2::OptionMenu->new
Makes you a brand new option menu. Classic constructor energy. β
integer = $option_menu->get_history
Hands you back the current history value as an integer. π
$option_menu->set_history ($index)
Sets the history to whatever index you pass in.
$index(integer)
widget = $option_menu->get_menu
Gives you the menu widget back. π¦
$option_menu->set_menu ($menu)
Swaps in a whole new menu.
$menu(Gtk2::Widget)
$option_menu->remove_menu
Yeets the menu right outta there. Bye bestie π
π PROPERTIES π
'menu'(Gtk2::Menu: defaultundef: readable / writable / private / static-nick / static-blurb) β The menu of options
π STYLE PROPERTIES π
'indicator-size'(Gtk2::Requisition: defaultundef: readable / private / static-nick / static-blurb) β Size of dropdown indicator'indicator-spacing'(Gtk2::Border: defaultundef: readable / private / static-nick / static-blurb) β Spacing around indicator
π₯ SIGNALS π₯
changed(Gtk2::OptionMenu)
That's it, that's the signal. She's lowkey minimal like that. π
π SEE ALSO π
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::Bin, Gtk2::Button
Basically the whole friend group. Go say hi. πΈ
π 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 β you ate that π
This lil slice of documentation came from the User Contributed Perl Documentation for Gtk2::OptionMenu(3), and it was baked with perl v5.42.0 back on 2025-07-25. Stan a classic, but go use Gtk2::ComboBox fr fr π«Άβ¨
π¦ 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