Gtk2::UIManager(3)

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

✨ 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 a Glib::Error in $@ if it fails. Like, actually. So wrap it, okay?

integer = $self->add_ui_from_string ($buffer)

  • $buffer (string)
Same vibe here β€” may croak with a Glib::Error in $@ 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 (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