Gtk2::UIManager(3)
β¨ NAME β¨
Gtk2::UIManager β bestie, it's literally just a wrapper for GtkUIManager π
πΈ HIERARCHY πΈ
Okay so the family tree goes like this, no cap:
Glib::Object
+----Gtk2::UIManager
π¦ INTERFACES π¦
It also serves looks as a:
Gtk2::Buildable
π METHODS π
uimanager = Gtk2::UIManager->new
Fresh new UIManager, brand new, main character energy β¨
integer = $self->new_merge_id
Hands you a shiny new merge id, an integer, for all your merging needs π
accelgroup = $self->get_accel_group
Gives you back the accel group, bestie β¨οΈ
action = $self->get_action ($path)
$path(string)
You pass a path, you get the action. Simple as π«Ά
list = $self->get_action_groups
A whole list of action groups, we love a list π
boolean = $self->get_add_tearoffs
Tells you whether tearoffs are being added β true or false, that's it π
$self->set_add_tearoffs ($add_tearoffs)
$add_tearoffs(boolean)
Sets that tearoff setting, periodt.
$self->add_ui ($merge_id, $path, $name, $action, $type, $top)
The big one, the icon of the method list π here's everything it wants:
$merge_id(integer)$path(string)$name(string)$action(string or undef)$type(Gtk2::UIManagerItemType)$top(boolean)
integer = $self->add_ui_from_file ($filename)
$filename(string)
Heads up bestie π this one may croak with aGlib::Errorin$@if it fails. Like, actually. So wrap it, okay?
integer = $self->add_ui_from_string ($buffer)
$buffer(string)
Same vibe here β may croak with aGlib::Errorin$@on failure. Don't say I didn't warn you π
$self->ensure_update
Makes sure the update actually happened. It's giving diligence π
$self->insert_action_group ($action_group, $pos)
$action_group(Gtk2::ActionGroup)$pos(integer)
Slides an action group in at the position you want, at exactly that $pos β¨
$self->remove_action_group ($action_group)
$action_group(Gtk2::ActionGroup)
Yeets that action group right out of there π
$self->remove_ui ($merge_id)
$merge_id(integer)
Undoes your UI merge, one id at a time π
list = $self->get_toplevels ($types)
$types(Gtk2::UIManagerItemType)
Give it the types, get back a list of toplevels. The way that works is so satisfying, ngl.
string = $self->get_ui
Returns the UI as a string π
widget = $self->get_widget ($path)
$path(string)
Path in, widget out. Chef's kiss π₯
π PROPERTIES π
'add-tearoffs'(boolean : default false : readable / writable / private / static-nick / static-blurb) β Whether tearoff menu items should be added to menus'ui'(string : default"<ui>\n</ui>\n": readable / private / static-nick / static-blurb) β An XML string describing the merged UI
π SIGNALS π
Like, the whole group chat of signals:
actions-changed(Gtk2::UIManager)add-widget(Gtk2::UIManager, Gtk2::Widget)connect-proxy(Gtk2::UIManager, Gtk2::Action, Gtk2::Widget)disconnect-proxy(Gtk2::UIManager, Gtk2::Action, Gtk2::Widget)post-activate(Gtk2::UIManager, Gtk2::Action)pre-activate(Gtk2::UIManager, Gtk2::Action)
π§ ENUMS AND FLAGS π§
flags Gtk2::UIManagerItemType
Every single one, in order, no skips bestie:
'auto'/GTK_UI_MANAGER_AUTO'menubar'/GTK_UI_MANAGER_MENUBAR'menu'/GTK_UI_MANAGER_MENU'toolbar'/GTK_UI_MANAGER_TOOLBAR'placeholder'/GTK_UI_MANAGER_PLACEHOLDER'popup'/GTK_UI_MANAGER_POPUP'menuitem'/GTK_UI_MANAGER_MENUITEM'toolitem'/GTK_UI_MANAGER_TOOLITEM'separator'/GTK_UI_MANAGER_SEPARATOR'accelerator'/GTK_UI_MANAGER_ACCELERATOR'popup-with-accels'/GTK_UI_MANAGER_POPUP_WITH_ACCELS
π SEE ALSO π
Go read these too, they're the whole friend group:
- Gtk2
- Glib::Object
π 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 was Gtk2::UIManager(3) from the User Contributed Perl Documentation, brought to you by perl v5.42.0 and dated 2025-07-25 β love u, go build something iconic πβ¨
π¦ 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