47
47
#include <gtk/gtk.h>
49
49
<a class="link" href="GtkFileSelection.html#GtkFileSelection-struct" title="GtkFileSelection">GtkFileSelection</a>;
50
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a>* <a class="link" href="GtkFileSelection.html#gtk-file-selection-new" title="gtk_file_selection_new ()">gtk_file_selection_new</a> (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *title</code></em>);
50
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a>* <a class="link" href="GtkFileSelection.html#gtk-file-selection-new" title="gtk_file_selection_new ()">gtk_file_selection_new</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *title</code></em>);
51
51
<span class="returnvalue">void</span> <a class="link" href="GtkFileSelection.html#gtk-file-selection-set-filename" title="gtk_file_selection_set_filename ()">gtk_file_selection_set_filename</a> (<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>,
52
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>);
53
const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* <a class="link" href="GtkFileSelection.html#gtk-file-selection-get-filename" title="gtk_file_selection_get_filename ()">gtk_file_selection_get_filename</a> (<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>);
52
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>);
53
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* <a class="link" href="GtkFileSelection.html#gtk-file-selection-get-filename" title="gtk_file_selection_get_filename ()">gtk_file_selection_get_filename</a> (<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>);
54
54
<span class="returnvalue">void</span> <a class="link" href="GtkFileSelection.html#gtk-file-selection-complete" title="gtk_file_selection_complete ()">gtk_file_selection_complete</a> (<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>,
55
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *pattern</code></em>);
55
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *pattern</code></em>);
56
56
<span class="returnvalue">void</span> <a class="link" href="GtkFileSelection.html#gtk-file-selection-show-fileop-buttons" title="gtk_file_selection_show_fileop_buttons ()">gtk_file_selection_show_fileop_buttons</a>
57
57
(<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>);
58
58
<span class="returnvalue">void</span> <a class="link" href="GtkFileSelection.html#gtk-file-selection-hide-fileop-buttons" title="gtk_file_selection_hide_fileop_buttons ()">gtk_file_selection_hide_fileop_buttons</a>
59
59
(<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>);
60
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>** <a class="link" href="GtkFileSelection.html#gtk-file-selection-get-selections" title="gtk_file_selection_get_selections ()">gtk_file_selection_get_selections</a> (<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>);
60
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>** <a class="link" href="GtkFileSelection.html#gtk-file-selection-get-selections" title="gtk_file_selection_get_selections ()">gtk_file_selection_get_selections</a> (<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>);
61
61
<span class="returnvalue">void</span> <a class="link" href="GtkFileSelection.html#gtk-file-selection-set-select-multiple" title="gtk_file_selection_set_select_multiple ()">gtk_file_selection_set_select_multiple</a>
62
62
(<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>,
63
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> select_multiple</code></em>);
64
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GtkFileSelection.html#gtk-file-selection-get-select-multiple" title="gtk_file_selection_get_select_multiple ()">gtk_file_selection_get_select_multiple</a>
63
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> select_multiple</code></em>);
64
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GtkFileSelection.html#gtk-file-selection-get-select-multiple" title="gtk_file_selection_get_select_multiple ()">gtk_file_selection_get_select_multiple</a>
65
65
(<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>);
68
68
<div class="refsect1" title="Object Hierarchy">
69
69
<a name="GtkFileSelection.object-hierarchy"></a><h2>Object Hierarchy</h2>
70
70
<pre class="synopsis">
71
<a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
72
+----<a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
71
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
72
+----<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
73
73
+----<a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a>
74
74
+----<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>
75
75
+----<a class="link" href="GtkContainer.html" title="GtkContainer">GtkContainer</a>
88
88
<div class="refsect1" title="Properties">
89
89
<a name="GtkFileSelection.properties"></a><h2>Properties</h2>
90
90
<pre class="synopsis">
91
"<a class="link" href="GtkFileSelection.html#GtkFileSelection--filename" title='The "filename" property'>filename</a>" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write
92
"<a class="link" href="GtkFileSelection.html#GtkFileSelection--select-multiple" title='The "select-multiple" property'>select-multiple</a>" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write
93
"<a class="link" href="GtkFileSelection.html#GtkFileSelection--show-fileops" title='The "show-fileops" property'>show-fileops</a>" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write
91
"<a class="link" href="GtkFileSelection.html#GtkFileSelection--filename" title='The "filename" property'>filename</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write
92
"<a class="link" href="GtkFileSelection.html#GtkFileSelection--select-multiple" title='The "select-multiple" property'>select-multiple</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write
93
"<a class="link" href="GtkFileSelection.html#GtkFileSelection--show-fileops" title='The "show-fileops" property'>show-fileops</a>" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write
96
96
<div class="refsect1" title="Description">
159
159
<td class="listing_code"><pre class="programlisting"><span class="comment">/* The file selection widget and the string to store the chosen filename */</span>
160
<span class="type">void</span><span class="normal"> </span><span class="function">store_filename</span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="GtkWidget.html">GtkWidget</a> </span><span class="symbol">*</span><span class="normal">widget</span><span class="symbol">,</span><span class="normal"> <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data</span><span class="symbol">)</span><span class="normal"> </span><span class="cbracket">{</span>
161
<span class="normal"> <a href="GtkWidget.html">GtkWidget</a> </span><span class="symbol">*</span><span class="normal">file_selector </span><span class="symbol">=</span><span class="normal"> </span><span class="function">GTK_WIDGET</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user_data</span><span class="symbol">);</span>
162
<span class="normal"> </span><span class="keyword">const</span><span class="normal"> <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> </span><span class="symbol">*</span><span class="normal">selected_filename</span><span class="symbol">;</span>
160
<span class="type">void</span><span class="normal"> </span><span class="function">store_filename</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GtkWidget</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">widget</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">gpointer</span><span class="normal"> user_data</span><span class="symbol">)</span><span class="normal"> </span><span class="cbracket">{</span>
161
<span class="normal"> </span><span class="usertype">GtkWidget</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">file_selector </span><span class="symbol">=</span><span class="normal"> </span><span class="function">GTK_WIDGET</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">user_data</span><span class="symbol">);</span>
162
<span class="normal"> </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">selected_filename</span><span class="symbol">;</span>
163
163
<span class="normal"> selected_filename </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkFileSelection.html#gtk-file-selection-get-filename">gtk_file_selection_get_filename</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_FILE_SELECTION</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file_selector</span><span class="symbol">));</span>
164
<span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/glib/glib-Warnings-and-Assertions.html#g-print">g_print</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Selected filename: %s</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> selected_filename</span><span class="symbol">);</span>
164
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Warnings-and-Assertions.html#g-print">g_print</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Selected filename: %s</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> selected_filename</span><span class="symbol">);</span>
165
165
<span class="cbracket">}</span>
166
166
<span class="type">void</span><span class="normal"> </span><span class="function">create_file_selection</span><span class="normal"> </span><span class="symbol">(</span><span class="type">void</span><span class="symbol">)</span><span class="normal"> </span><span class="cbracket">{</span>
167
<span class="normal"> <a href="GtkWidget.html">GtkWidget</a> </span><span class="symbol">*</span><span class="normal">file_selector</span><span class="symbol">;</span>
167
<span class="normal"> </span><span class="usertype">GtkWidget</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">file_selector</span><span class="symbol">;</span>
168
168
<span class="normal"> </span><span class="comment">/* Create the selector */</span>
169
169
<span class="normal"> file_selector </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkFileSelection.html#gtk-file-selection-new">gtk_file_selection_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Please select a file for editing."</span><span class="symbol">);</span>
170
<span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-connect">g_signal_connect</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_FILE_SELECTION</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file_selector</span><span class="symbol">)-></span><span class="normal">ok_button</span><span class="symbol">,</span>
170
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect">g_signal_connect</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_FILE_SELECTION</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file_selector</span><span class="symbol">)-></span><span class="normal">ok_button</span><span class="symbol">,</span>
171
171
<span class="normal"> </span><span class="string">"clicked"</span><span class="symbol">,</span>
172
<span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">store_filename</span><span class="symbol">),</span>
172
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">store_filename</span><span class="symbol">),</span>
173
173
<span class="normal"> file_selector</span><span class="symbol">);</span>
174
174
<span class="normal"> </span><span class="comment">/* Ensure that the dialog box is destroyed when the user clicks a button. */</span>
175
<span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-connect-swapped">g_signal_connect_swapped</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_FILE_SELECTION</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file_selector</span><span class="symbol">)-></span><span class="normal">ok_button</span><span class="symbol">,</span>
175
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect-swapped">g_signal_connect_swapped</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_FILE_SELECTION</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file_selector</span><span class="symbol">)-></span><span class="normal">ok_button</span><span class="symbol">,</span>
176
176
<span class="normal"> </span><span class="string">"clicked"</span><span class="symbol">,</span>
177
<span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="GtkWidget.html#gtk-widget-destroy">gtk_widget_destroy</a></span><span class="symbol">),</span>
177
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="GtkWidget.html#gtk-widget-destroy">gtk_widget_destroy</a></span><span class="symbol">),</span>
178
178
<span class="normal"> file_selector</span><span class="symbol">);</span>
179
<span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-connect-swapped">g_signal_connect_swapped</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_FILE_SELECTION</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file_selector</span><span class="symbol">)-></span><span class="normal">cancel_button</span><span class="symbol">,</span>
179
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect-swapped">g_signal_connect_swapped</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_FILE_SELECTION</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file_selector</span><span class="symbol">)-></span><span class="normal">cancel_button</span><span class="symbol">,</span>
180
180
<span class="normal"> </span><span class="string">"clicked"</span><span class="symbol">,</span>
181
<span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="GtkWidget.html#gtk-widget-destroy">gtk_widget_destroy</a></span><span class="symbol">),</span>
181
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="GtkWidget.html#gtk-widget-destroy">gtk_widget_destroy</a></span><span class="symbol">),</span>
182
182
<span class="normal"> file_selector</span><span class="symbol">);</span>
183
183
<span class="normal"> </span><span class="comment">/* Display that dialog */</span>
184
184
<span class="normal"> </span><span class="function"><a href="GtkWidget.html#gtk-widget-show">gtk_widget_show</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file_selector</span><span class="symbol">);</span>
412
412
<div class="refsect2" title="gtk_file_selection_get_filename ()">
413
413
<a name="gtk-file-selection-get-filename"></a><h3>gtk_file_selection_get_filename ()</h3>
414
<pre class="programlisting">const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* gtk_file_selection_get_filename (<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>);</pre>
414
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a>* gtk_file_selection_get_filename (<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>);</pre>
415
415
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
416
416
<h3 class="title">Warning</h3>
417
417
<p><code class="literal">gtk_file_selection_get_filename</code> is deprecated and should not be used in newly-written code.</p>
420
420
This function returns the selected filename in the GLib file name
421
encoding. To convert to UTF-8, call <a href="/usr/share/gtk-doc/html/glib/glib-Character-Set-Conversion.html#g-filename-to-utf8"><code class="function">g_filename_to_utf8()</code></a>. The
421
encoding. To convert to UTF-8, call <a href="http://library.gnome.org/devel/glib/unstable/glib-Character-Set-Conversion.html#g-filename-to-utf8"><code class="function">g_filename_to_utf8()</code></a>. The
422
422
returned string points to a statically allocated buffer and should
423
423
be copied if you plan to keep it around.
614
614
<a name="GtkFileSelection.property-details"></a><h2>Property Details</h2>
615
615
<div class="refsect2" title='The "filename" property'>
616
616
<a name="GtkFileSelection--filename"></a><h3>The <code class="literal">"filename"</code> property</h3>
617
<pre class="programlisting"> "filename" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write</pre>
617
<pre class="programlisting"> "filename" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write</pre>
618
618
<p>The currently selected filename.</p>
619
619
<p>Default value: NULL</p>
622
622
<div class="refsect2" title='The "select-multiple" property'>
623
623
<a name="GtkFileSelection--select-multiple"></a><h3>The <code class="literal">"select-multiple"</code> property</h3>
624
<pre class="programlisting"> "select-multiple" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write</pre>
624
<pre class="programlisting"> "select-multiple" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write</pre>
625
625
<p>Whether to allow multiple files to be selected.</p>
626
626
<p>Default value: FALSE</p>
629
629
<div class="refsect2" title='The "show-fileops" property'>
630
630
<a name="GtkFileSelection--show-fileops"></a><h3>The <code class="literal">"show-fileops"</code> property</h3>
631
<pre class="programlisting"> "show-fileops" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write</pre>
631
<pre class="programlisting"> "show-fileops" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write</pre>
632
632
<p>Whether buttons for creating/manipulating files should be displayed.</p>
633
633
<p>Default value: TRUE</p>