47
47
#include <gtk/gtk.h>
49
49
struct <a class="link" href="GtkFileSelection.html#GtkFileSelection-struct" title="struct 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 <span class="type">gchar</span> *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
#define <a class="link" href="GtkFileSelection.html#gtk-file-selection-set-filename" title="gtk_file_selection_set_filename">gtk_file_selection_set_filename</a>
52
52
#define <a class="link" href="GtkFileSelection.html#gtk-file-selection-get-filename" title="gtk_file_selection_get_filename">gtk_file_selection_get_filename</a>
53
53
<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>,
54
<em class="parameter"><code>const <span class="type">gchar</span> *pattern</code></em>);
54
<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>);
55
55
<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>
56
56
(<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>);
57
57
<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
#define <a class="link" href="GtkFileSelection.html#gtk-file-selection-get-selections" title="gtk_file_selection_get_selections">gtk_file_selection_get_selections</a>
60
60
<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>
61
61
(<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>,
62
<em class="parameter"><code><span class="type">gboolean</span> select_multiple</code></em>);
63
<span class="returnvalue">gboolean</span> <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>
62
<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>);
63
<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>
64
64
(<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>);
67
67
<div class="refsect1">
68
68
<a name="GtkFileSelection.object-hierarchy"></a><h2>Object Hierarchy</h2>
69
69
<pre class="synopsis">
71
+----GInitiallyUnowned
70
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
71
+----<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
72
72
+----<a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a>
73
73
+----<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>
74
74
+----<a class="link" href="GtkContainer.html" title="GtkContainer">GtkContainer</a>
87
87
<div class="refsect1">
88
88
<a name="GtkFileSelection.properties"></a><h2>Properties</h2>
89
89
<pre class="synopsis">
90
"<a class="link" href="GtkFileSelection.html#GtkFileSelection--filename" title='The "filename" property'>filename</a>" <span class="type">gchar</span>* : Read / Write
91
"<a class="link" href="GtkFileSelection.html#GtkFileSelection--select-multiple" title='The "select-multiple" property'>select-multiple</a>" <span class="type">gboolean</span> : Read / Write
92
"<a class="link" href="GtkFileSelection.html#GtkFileSelection--show-fileops" title='The "show-fileops" property'>show-fileops</a>" <span class="type">gboolean</span> : Read / Write
90
"<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
91
"<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
92
"<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
95
95
<div class="refsect1">
160
160
<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>
161
161
<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>
162
162
<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>
163
<span class="normal"> </span><span class="function">g_print</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>
163
<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>
164
164
<span class="cbracket">}</span>
165
165
<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>
166
166
<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>
167
167
<span class="normal"> </span><span class="comment">/* Create the selector */</span>
168
168
<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>
169
<span class="normal"> </span><span class="function">g_signal_connect</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>
169
<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>
170
170
<span class="normal"> </span><span class="string">"clicked"</span><span class="symbol">,</span>
171
<span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">store_filename</span><span class="symbol">),</span>
171
<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>
172
172
<span class="normal"> file_selector</span><span class="symbol">);</span>
173
173
<span class="normal"> </span><span class="comment">/* Ensure that the dialog box is destroyed when the user clicks a button. */</span>
174
<span class="normal"> </span><span class="function">g_signal_connect_swapped</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>
174
<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>
175
175
<span class="normal"> </span><span class="string">"clicked"</span><span class="symbol">,</span>
176
<span class="normal"> </span><span class="function">G_CALLBACK</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>
176
<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>
177
177
<span class="normal"> file_selector</span><span class="symbol">);</span>
178
<span class="normal"> </span><span class="function">g_signal_connect_swapped</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>
178
<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>
179
179
<span class="normal"> </span><span class="string">"clicked"</span><span class="symbol">,</span>
180
<span class="normal"> </span><span class="function">G_CALLBACK</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>
180
<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>
181
181
<span class="normal"> file_selector</span><span class="symbol">);</span>
182
182
<span class="normal"> </span><span class="comment">/* Display that dialog */</span>
183
183
<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>
325
325
<div class="refsect2">
326
326
<a name="gtk-file-selection-new"></a><h3>gtk_file_selection_new ()</h3>
327
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * gtk_file_selection_new (<em class="parameter"><code>const <span class="type">gchar</span> *title</code></em>);</pre>
327
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * gtk_file_selection_new (<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>);</pre>
328
328
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
329
329
<h3 class="title">Warning</h3>
330
330
<p><code class="literal">gtk_file_selection_new</code> is deprecated and should not be used in newly-written code. Use <a class="link" href="GtkFileChooserDialog.html#gtk-file-chooser-dialog-new" title="gtk_file_chooser_dialog_new ()"><code class="function">gtk_file_chooser_dialog_new()</code></a> instead</p>
413
413
<div class="refsect2">
414
414
<a name="gtk-file-selection-complete"></a><h3>gtk_file_selection_complete ()</h3>
415
415
<pre class="programlisting"><span class="returnvalue">void</span> gtk_file_selection_complete (<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>,
416
<em class="parameter"><code>const <span class="type">gchar</span> *pattern</code></em>);</pre>
416
<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>);</pre>
417
417
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
418
418
<h3 class="title">Warning</h3>
419
419
<p><code class="literal">gtk_file_selection_complete</code> is deprecated and should not be used in newly-written code.</p>
496
496
The filenames are in the GLib file name encoding. To convert to
497
UTF-8, call <code class="function">g_filename_to_utf8()</code> on each string.
497
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> on each string.
499
499
<div class="variablelist"><table border="0">
500
500
<col align="left" valign="top">
502
502
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
503
<td>a newly-allocated <a href="/home/mclasen/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL--CAPS"><code class="literal">NULL</code></a>-terminated array of strings. Use
504
<code class="function">g_strfreev()</code> to free it.</td>
503
<td>a newly-allocated <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated array of strings. Use
504
<a href="http://library.gnome.org/devel/glib/unstable/glib-String-Utility-Functions.html#g-strfreev"><code class="function">g_strfreev()</code></a> to free it.</td>
510
510
<a name="gtk-file-selection-set-select-multiple"></a><h3>gtk_file_selection_set_select_multiple ()</h3>
511
511
<pre class="programlisting"><span class="returnvalue">void</span> gtk_file_selection_set_select_multiple
512
512
(<em class="parameter"><code><a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> *filesel</code></em>,
513
<em class="parameter"><code><span class="type">gboolean</span> select_multiple</code></em>);</pre>
513
<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>);</pre>
514
514
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
515
515
<h3 class="title">Warning</h3>
516
516
<p><code class="literal">gtk_file_selection_set_select_multiple</code> is deprecated and should not be used in newly-written code.</p>
570
570
<a name="GtkFileSelection.property-details"></a><h2>Property Details</h2>
571
571
<div class="refsect2">
572
572
<a name="GtkFileSelection--filename"></a><h3>The <code class="literal">"filename"</code> property</h3>
573
<pre class="programlisting"> "filename" <span class="type">gchar</span>* : Read / Write</pre>
573
<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>
574
574
<p>The currently selected filename.</p>
575
575
<p>Default value: NULL</p>
578
578
<div class="refsect2">
579
579
<a name="GtkFileSelection--select-multiple"></a><h3>The <code class="literal">"select-multiple"</code> property</h3>
580
<pre class="programlisting"> "select-multiple" <span class="type">gboolean</span> : Read / Write</pre>
580
<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>
581
581
<p>Whether to allow multiple files to be selected.</p>
582
582
<p>Default value: FALSE</p>
585
585
<div class="refsect2">
586
586
<a name="GtkFileSelection--show-fileops"></a><h3>The <code class="literal">"show-fileops"</code> property</h3>
587
<pre class="programlisting"> "show-fileops" <span class="type">gboolean</span> : Read / Write</pre>
587
<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>
588
588
<p>Whether buttons for creating/manipulating files should be displayed.</p>
589
589
<p>Default value: TRUE</p>