1
2@c %start of fragment
3
4@node GtkRecentChooserDialog
5@chapter GtkRecentChooserDialog
6Displays recently used files in a dialog
7
8@section Overview
9@code{<gtk-recent-chooser-dialog>} is a dialog box suitable for displaying the
10recently used documents. This widgets works by putting a
11@code{<gtk-recent-chooser-widget>} inside a @code{<gtk-dialog>}. It exposes the
12@code{<gtk-recent-chooser-iface>} interface, so you can use all the
13@code{<gtk-recent-chooser>} functions on the recent chooser dialog as well as
14those for @code{<gtk-dialog>}.
15
16Note that @code{<gtk-recent-chooser-dialog>} does not have any methods of its
17own. Instead, you should use the functions that work on a
18@code{<gtk-recent-chooser>}.
19
20In the simplest of cases, you can use the following code to use a
21@code{<gtk-recent-chooser-dialog>} to select a recently used file:
22
23@example
24
25GtkWidget *dialog;
26
27dialog = gtk_recent_chooser_dialog_new ("Recent Documents",
28					parent_window,
29					GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
30					GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
31					NULL);
32
33if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
34  @{
35    GtkRecentInfo *info;
36
37    info = gtk_recent_chooser_get_current_item (GTK_RECENT_CHOOSER (dialog));
38    open_file (gtk_recent_info_get_uri (info));
39    gtk_recent_info_unref (info);
40  @}
41
42gtk_widget_destroy (dialog);
43
44@end example
45
46Recently used files are supported since GTK+ 2.10.
47
48@section Usage
49@include defuns-gtkrecentchooserdialog.xml.texi
50
51@c %end of fragment
52