RecentChooserMenu


Object Hierarchy:

Gtk.RecentChooserMenu Gtk.RecentChooserMenu Gtk.RecentChooserMenu Gtk.Menu Gtk.Menu Gtk.Menu->Gtk.RecentChooserMenu Gtk.MenuShell Gtk.MenuShell Gtk.MenuShell->Gtk.Menu Gtk.Container Gtk.Container Gtk.Container->Gtk.MenuShell Gtk.Widget Gtk.Widget Gtk.Widget->Gtk.Container GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Atk.Implementor Atk.Implementor Atk.Implementor->Gtk.RecentChooserMenu Atk.Implementor->Gtk.Menu Atk.Implementor->Gtk.MenuShell Atk.Implementor->Gtk.Container Atk.Implementor->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.RecentChooserMenu Gtk.Buildable->Gtk.Menu Gtk.Buildable->Gtk.MenuShell Gtk.Buildable->Gtk.Container Gtk.Buildable->Gtk.Widget Gtk.Activatable Gtk.Activatable Gtk.Activatable->Gtk.RecentChooserMenu Gtk.RecentChooser Gtk.RecentChooser Gtk.RecentChooser->Gtk.RecentChooserMenu

Description:

[ CCode ( type_id = "gtk_recent_chooser_menu_get_type ()" ) ]
public class RecentChooserMenu : Menu, Implementor, Activatable, Buildable, RecentChooser

RecentChooserMenu is a widget suitable for displaying recently used files inside a menu.

It can be used to set a sub-menu of a MenuItem using set_submenu, or as the menu of a MenuToolButton.

Note that RecentChooserMenu does not have any methods of its own. Instead, you should use the functions that work on a RecentChooser.

Note also that RecentChooserMenu does not support multiple filters, as it has no way to let the user choose between them as the RecentChooserWidget and RecentChooserDialog widgets do. Thus using add_filter on a RecentChooserMenu widget will yield the same effects as using set_filter, replacing any currently set filter with the supplied filter; remove_filter will remove any currently set RecentFilter object and will unset the current filter; list_filters will return a list containing a single RecentFilter object.

Recently used files are supported since GTK+ 2.10.

Example: RecentChooserMenu:

public class Application : Gtk.Window {
public Application () {
// Prepare Gtk.Window:
this.title = "My Gtk.RecentChooserMenu";
this.window_position = Gtk.WindowPosition.CENTER;
this.destroy.connect (Gtk.main_quit);

// MenuBar:
Gtk.MenuBar bar = new Gtk.MenuBar ();
this.add (bar);

// File:
Gtk.MenuItem item_file = new Gtk.MenuItem.with_label ("File");
bar.add (item_file);

Gtk.RecentChooserMenu recent = new Gtk.RecentChooserMenu ();
item_file.set_submenu (recent);

recent.item_activated.connect (() => {
Gtk.RecentInfo info = recent.get_current_item ();
print ("%s\n", info.get_uri ());
});
}

public static int main (string[] args) {
Gtk.init (ref args);

Application app = new Application ();
app.show_all ();
Gtk.main ();
return 0;
}
}

valac --pkg gtk+-3.0 Gtk.RecentChooserMenu.vala


Namespace: Gtk
Package: gtk+-3.0

Content:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class Gtk.Widget
All known members inherited from interface Atk.Implementor