Gtk2::R...tManager(3)
π NAME π
okay so bestie, welcome to Gtk2::RecentManager β it's literally just a wrapper for GtkRecentManager, no cap. β¨
This page lives in the User Contributed Perl Documentation collection, and it's giving very "the girl who remembers every file you've ever opened" energy. π
π¦ HIERARCHY π¦
the family tree, and yes she comes from good stock:
Glib::Object
+----Gtk2::RecentManager
β¨ METHODS β¨
πΈ recentmanager = Gtk2::RecentManager->new
make a brand new one, bestie. fresh start, main character energy. π
πΈ boolean = $manager->add_full ($uri, $data)
$uri(string) β the doc's URI, obviously$data(scalar) β the meta-data, hand-delivered by you
okay so this adds $uri to the list of recently used documents. but here's the thing β instead of letting the Gtk2::RecentManager object guess the meta-data (imagine guessing, couldn't be me π), you use $data to supply it directly. very girlboss of you.
$data is a hash reference, and these are the keys it takes:
π display_name
the name used when displaying the document inside the recently used documents list. it's the lil name tag. π·οΈ
π description
a short description of the document. keep it cute, keep it brief.
π mime_type
the MIME type of the document. [Mandatory] β like, you literally cannot skip this one, bestie, it's required. π¨
π app_name
the name of the application that is registering the document. you might use the same name you used in "Glib::set_application_name" (see Glib::Utils). consistency is iconic. β¨
π app_exec
the command line needed to launch the application with the document. you can use the variable "%u", which will be expanded to the document's URI, or the variable "%f" which will be expanded to the document's canonical full path. little placeholders doing the most, love that for them. π«Ά
π groups
an array reference, containing the group names the document belongs to. squad goals fr fr.
π is_private
whether the document should be visible only to the applications and groups that have registered it. π€« private mode, we respect it.
πΈ boolean = $manager->add_item ($uri)
$uri(string) β yes, the URI again
adds $uri to the list of recently used documents. the Gtk2::RecentManager object will try to guess the meta-data of the document from its URI β but ngl, if you already know it, you should use "add_full" above instead. guessing is lowkey risky. π
πΈ recentmanager = Gtk2::RecentManager->get_default
the default one. the main one. the moment. π«
πΈ recentmanager = Gtk2::RecentManager->get_for_screen ($screen)
$screen(Gtk2::Gdk::Screen) β the screen in question
πΈ boolean = $manager->has_item ($uri)
$uri(string)
πΈ (items) = $manager->get_items
all of them. the whole collection. π
πΈ integer = $manager->get_limit
how many she's allowed to keep around. β
πΈ $manager->set_limit ($limit)
$limit(integer) β the new cap
πΈ recentinfo = $manager->lookup_item ($uri)
$uri(string)
β οΈ heads up bestie: this one may croak with aGlib::Errorin$@on failure. so like, wrap it in anevalunless you enjoy chaos. π
πΈ $manager->move_item ($old_uri, $new_uri)
$old_uri(string)$new_uri(string or undef)
β οΈ also may croak with aGlib::Errorin$@on failure. handle with care, queen. π«Ά
πΈ integer = $manager->purge_items
β οΈ may croak with aGlib::Errorin$@on failure. clearing house is dramatic like that. π₯
πΈ $manager->remove_item ($uri)
$uri(string)
β οΈ may croak with aGlib::Errorin$@on failure. bye bestie π
πΈ $manager->set_screen ($screen)
$screen(Gtk2::Gdk::Screen)
π PROPERTIES π
'filename'(string : default undef : readable / writable / construct-only) β the full path to the file to be used to store and read the list. she's construct-only, so decide early, no take-backs. πΈ'limit'(integer : default -1 : readable / writable / deprecated) β the maximum number of items to be returned bygtk_recent_manager_get_items(). deprecated alert π¨ it's giving legacy behaviour, iykyk.'size'(integer : default 0 : readable) β the size of the recently used resources list. read-only, she just observes. π
β SIGNALS β
changed(Gtk2::RecentManager) β she changed, and she wants you to know. π£
π ENUMS AND FLAGS π
π enum GtkRecentManagerError
all the ways things can go wrong, and yes, there are seven:
'not-found'/GTK_RECENT_MANAGER_ERROR_NOT_FOUND'invalid-uri'/GTK_RECENT_MANAGER_ERROR_INVALID_URI'invalid-encoding'/GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING'not-registered'/GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED'read'/GTK_RECENT_MANAGER_ERROR_READ'write'/GTK_RECENT_MANAGER_ERROR_WRITE'unknown'/GTK_RECENT_MANAGER_ERROR_UNKNOWN
π SEE ALSO π
Gtk2, Glib::Object β go read those too, bestie, they're the supporting cast. π«Ά
π COPYRIGHT π
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.
and that's the whole page, periodt. β¨ this little doc came to you from the perl v5.42.0 era, dated 2025-07-25, filed under Gtk2::R...tManager(3) β the truncated title is not me being lazy, that's genuinely how the footer spells it, and honestly? iconic. slay, take care of your recently-used list, mwah π
π
π¦ 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