Back to Seed Clases

Gtk


Classes

Interfaces

Structs

Unions

Enums

GObject.Object
parent-child marker Gtk.RecentManager

Class Gtk.RecentManager

Import line: Gtk = imports.gi.Gtk;
GIR File: Gtk-3.0.gir
C documentation: GtkRecentManager
Class : RecentManager
Extends: GObject.Object
GtkRecentManager provides a facility for adding, removing and
looking up recently used files. Each recently used file is
identified by its URI, and has meta-data associated to it, like
the names and command lines of the applications that have
registered it, the number of time each application has registered
the same file, the mime type of the file and whether the file
should be displayed only by the applications that have
registered it.
The recently used files list is per user.
The GtkRecentManager acts like a database of all the recently
used files. You can create new GtkRecentManager objects, but
it is more efficient to use the default manager created by GTK+.
Adding a new recently used file is as simple as:
|[
GtkRecentManager *manager;
manager = gtk_recent_manager_get_default ();
gtk_recent_manager_add_item (manager, file_uri);
]|
The GtkRecentManager will try to gather all the needed information
from the file itself through GIO.
Looking up the meta-data associated with a recently used file
given its URI requires calling gtk_recent_manager_lookup_item():
|[
GtkRecentManager *manager;
GtkRecentInfo *info;
GError *error = NULL;
manager = gtk_recent_manager_get_default ();
info = gtk_recent_manager_lookup_item (manager, file_uri, &error);
if (error)
{
g_error_free (error);
}
else
{
/* Use the info object */
gtk_recent_info_unref (info);
}
]|
In order to retrieve the list of recently used files, you can use
gtk_recent_manager_get_items(), which returns a list of GtkRecentInfo
structures.
A GtkRecentManager is the model used to populate the contents of
one, or more GtkRecentChooser implementations.
The maximum age of the recently used files list is
controllable through the GtkSettings:gtk-recent-files-max-age
property.

Recently used files are supported since GTK+ 2.10.
Properties
Properties Defined By
Methods / Constructors
Method / Constructor Defined By
Events - usage syntax: this.signals.EVENTNAME.connect( Function )
Event Defined By
Used by These Methods / Signals / Properties
Class / Namespace Method / Signal / Properties
Gtk.RecentAction
Method
new Gtk.RecentAction.for_manager (String name, String label, String tooltip, String stock_id, RecentManager manager) : Gtk.Action
Create a new Gtk.RecentAction
Gtk.RecentChooser
Property
recent_manager : Gtk.RecentManager
The GtkRecentManager instance used by the GtkRecentChooser to
display the list of recently used resources.
Gtk.RecentChooserMenu
Method
new Gtk.RecentChooserMenu.for_manager (RecentManager manager) : Gtk.Widget
Create a new Gtk.RecentChooserMenu
Gtk.RecentChooserWidget
Method
new Gtk.RecentChooserWidget.for_manager (RecentManager manager) : Gtk.Widget
Create a new Gtk.RecentChooserWidget
Documentation generated by Introspection Doc Generator Loosely Based on JsDoc Toolkit on Sat Apr 16 2011 17:13:43 GMT+0800 (HKT)