1
<refentry id="GtkRecentChooserDialog">
3
<refentrytitle role="top_of_page">GtkRecentChooserDialog</refentrytitle>
4
<manvolnum>3</manvolnum>
5
<refmiscinfo>GTK Library</refmiscinfo>
9
<refname>GtkRecentChooserDialog</refname>
10
<refpurpose>Displays recently used files in a dialog</refpurpose>
11
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
14
<refsynopsisdiv role="synopsis">
15
<title role="synopsis.title">Synopsis</title>
19
#include <gtk/gtk.h>
22
<link linkend="GtkRecentChooserDialog-struct">GtkRecentChooserDialog</link>;
23
<link linkend="GtkWidget">GtkWidget</link>* <link linkend="gtk-recent-chooser-dialog-new">gtk_recent_chooser_dialog_new</link> (const <link linkend="gchar">gchar</link> *title,
24
<link linkend="GtkWindow">GtkWindow</link> *parent,
25
const <link linkend="gchar">gchar</link> *first_button_text,
27
<link linkend="GtkWidget">GtkWidget</link>* <link linkend="gtk-recent-chooser-dialog-new-for-manager">gtk_recent_chooser_dialog_new_for_manager</link>
28
(const <link linkend="gchar">gchar</link> *title,
29
<link linkend="GtkWindow">GtkWindow</link> *parent,
30
<link linkend="GtkRecentManager">GtkRecentManager</link> *manager,
31
const <link linkend="gchar">gchar</link> *first_button_text,
38
<refsect1 role="object_hierarchy">
39
<title role="object_hierarchy.title">Object Hierarchy</title>
42
<link linkend="GObject">GObject</link>
43
+----<link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
44
+----<link linkend="GtkObject">GtkObject</link>
45
+----<link linkend="GtkWidget">GtkWidget</link>
46
+----<link linkend="GtkContainer">GtkContainer</link>
47
+----<link linkend="GtkBin">GtkBin</link>
48
+----<link linkend="GtkWindow">GtkWindow</link>
49
+----<link linkend="GtkDialog">GtkDialog</link>
50
+----GtkRecentChooserDialog
57
<refsect1 role="impl_interfaces">
58
<title role="impl_interfaces.title">Implemented Interfaces</title>
60
GtkRecentChooserDialog implements
61
<link linkend="AtkImplementorIface">AtkImplementorIface</link> and <link linkend="GtkRecentChooser">GtkRecentChooser</link>.</para>
69
<refsect1 role="desc">
70
<title role="desc.title">Description</title>
72
<link linkend="GtkRecentChooserDialog"><type>GtkRecentChooserDialog</type></link> is a dialog box suitable for displaying the recently
73
used documents. This widgets works by putting a <link linkend="GtkRecentChooserWidget"><type>GtkRecentChooserWidget</type></link> inside
74
a <link linkend="GtkDialog"><type>GtkDialog</type></link>. It exposes the <link linkend="GtkRecentChooserIface"><type>GtkRecentChooserIface</type></link> interface, so you can use
75
all the <link linkend="GtkRecentChooser"><type>GtkRecentChooser</type></link> functions on the recent chooser dialog as well as
76
those for <link linkend="GtkDialog"><type>GtkDialog</type></link>.
80
Note that <link linkend="GtkRecentChooserDialog"><type>GtkRecentChooserDialog</type></link> does not have any methods of its own.
81
Instead, you should use the functions that work on a <link linkend="GtkRecentChooser"><type>GtkRecentChooser</type></link>.
84
<example id="gtkrecentchooser-typical-usage">
85
<title>Typical usage</title>
88
In the simplest of cases, you can use the following code to use
89
a <link linkend="GtkRecentChooserDialog"><type>GtkRecentChooserDialog</type></link> to select a recently used file:
95
dialog = gtk_recent_chooser_dialog_new ("Recent Documents",
97
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
98
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
101
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
105
info = gtk_recent_chooser_get_current_item (GTK_RECENT_CHOOSER (dialog));
106
open_file (gtk_recent_info_get_uri (info));
107
gtk_recent_info_unref (info);
110
gtk_widget_destroy (dialog);
115
Recently used files are supported since GTK+ 2.10.
119
<refsect1 role="details">
120
<title role="details.title">Details</title>
122
<title><anchor id="GtkRecentChooserDialog-struct" role="struct"/>GtkRecentChooserDialog</title>
123
<indexterm><primary>GtkRecentChooserDialog</primary></indexterm><programlisting>typedef struct _GtkRecentChooserDialog GtkRecentChooserDialog;</programlisting>
128
<title><anchor id="gtk-recent-chooser-dialog-new" role="function" condition="since:2.10"/>gtk_recent_chooser_dialog_new ()</title>
129
<indexterm role="2.10"><primary>gtk_recent_chooser_dialog_new</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>* gtk_recent_chooser_dialog_new (const <link linkend="gchar">gchar</link> *title,
130
<link linkend="GtkWindow">GtkWindow</link> *parent,
131
const <link linkend="gchar">gchar</link> *first_button_text,
132
...);</programlisting>
134
Creates a new <link linkend="GtkRecentChooserDialog"><type>GtkRecentChooserDialog</type></link>. This function is analogous to
135
<link linkend="gtk-dialog-new-with-buttons"><function>gtk_dialog_new_with_buttons()</function></link>.</para>
138
</para><variablelist role="params">
139
<varlistentry><term><parameter>title</parameter> :</term>
140
<listitem><simpara> Title of the dialog, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
141
</simpara></listitem></varlistentry>
142
<varlistentry><term><parameter>parent</parameter> :</term>
143
<listitem><simpara> Transient parent of the dialog, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>,
144
</simpara></listitem></varlistentry>
145
<varlistentry><term><parameter>first_button_text</parameter> :</term>
146
<listitem><simpara> stock ID or text to go in the first button, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
147
</simpara></listitem></varlistentry>
148
<varlistentry><term><parameter>...</parameter> :</term>
149
<listitem><simpara> response ID for the first button, then additional (button, id)
150
pairs, ending with <link linkend="NULL:CAPS"><literal>NULL</literal></link>
151
</simpara></listitem></varlistentry>
152
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a new <link linkend="GtkRecentChooserDialog"><type>GtkRecentChooserDialog</type></link>
154
</simpara></listitem></varlistentry>
155
</variablelist><para role="since">Since 2.10
158
<title><anchor id="gtk-recent-chooser-dialog-new-for-manager" role="function" condition="since:2.10"/>gtk_recent_chooser_dialog_new_for_manager ()</title>
159
<indexterm role="2.10"><primary>gtk_recent_chooser_dialog_new_for_manager</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>* gtk_recent_chooser_dialog_new_for_manager
160
(const <link linkend="gchar">gchar</link> *title,
161
<link linkend="GtkWindow">GtkWindow</link> *parent,
162
<link linkend="GtkRecentManager">GtkRecentManager</link> *manager,
163
const <link linkend="gchar">gchar</link> *first_button_text,
164
...);</programlisting>
166
Creates a new <link linkend="GtkRecentChooserDialog"><type>GtkRecentChooserDialog</type></link> with a specified recent manager.
169
This is useful if you have implemented your own recent manager, or if you
170
have a customized instance of a <link linkend="GtkRecentManager"><type>GtkRecentManager</type></link> object.</para>
173
</para><variablelist role="params">
174
<varlistentry><term><parameter>title</parameter> :</term>
175
<listitem><simpara> Title of the dialog, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
176
</simpara></listitem></varlistentry>
177
<varlistentry><term><parameter>parent</parameter> :</term>
178
<listitem><simpara> Transient parent of the dialog, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>,
179
</simpara></listitem></varlistentry>
180
<varlistentry><term><parameter>manager</parameter> :</term>
181
<listitem><simpara> a <link linkend="GtkRecentManager"><type>GtkRecentManager</type></link>
182
</simpara></listitem></varlistentry>
183
<varlistentry><term><parameter>first_button_text</parameter> :</term>
184
<listitem><simpara> stock ID or text to go in the first button, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
185
</simpara></listitem></varlistentry>
186
<varlistentry><term><parameter>...</parameter> :</term>
187
<listitem><simpara> response ID for the first button, then additional (button, id)
188
pairs, ending with <link linkend="NULL:CAPS"><literal>NULL</literal></link>
189
</simpara></listitem></varlistentry>
190
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a new <link linkend="GtkRecentChooserDialog"><type>GtkRecentChooserDialog</type></link>
192
</simpara></listitem></varlistentry>
193
</variablelist><para role="since">Since 2.10
201
<title>See Also</title>
203
<link linkend="GtkRecentChooser"><type>GtkRecentChooser</type></link>, <link linkend="GtkDialog"><type>GtkDialog</type></link>