New upstream version 3.24.14

This commit is contained in:
Simon McVittie
2020-02-29 14:17:40 +00:00
543 changed files with 330694 additions and 808714 deletions

View File

@ -8,7 +8,7 @@
<link rel="up" href="SelectorWidgets.html" title="Selector Widgets and Dialogs">
<link rel="prev" href="GtkColorChooserDialog.html" title="GtkColorChooserDialog">
<link rel="next" href="GtkFileChooserButton.html" title="GtkFileChooserButton">
<meta name="generator" content="GTK-Doc V1.29 (XML mode)">
<meta name="generator" content="GTK-Doc V1.32.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@ -40,8 +40,8 @@
<a name="GtkFileChooser.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
@ -54,7 +54,7 @@
</tr>
<tr>
<td class="function_type">
<a class="link" href="GtkFileChooser.html#GtkFileChooserAction" title="enum GtkFileChooserAction"><span class="returnvalue">GtkFileChooserAction</span></a>
<a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GtkFileChooserAction"><span class="returnvalue">GtkFileChooserAction</span></a>
</td>
<td class="function_name">
<a class="link" href="GtkFileChooser.html#gtk-file-chooser-get-action" title="gtk_file_chooser_get_action ()">gtk_file_chooser_get_action</a> <span class="c_punctuation">()</span>
@ -560,7 +560,7 @@
</colgroup>
<tbody>
<tr>
<td class="property_type"><a class="link" href="GtkFileChooser.html#GtkFileChooserAction" title="enum GtkFileChooserAction"><span class="type">GtkFileChooserAction</span></a></td>
<td class="property_type"><a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GtkFileChooserAction"><span class="type">GtkFileChooserAction</span></a></td>
<td class="property_name"><a class="link" href="GtkFileChooser.html#GtkFileChooser--action" title="The “action” property">action</a></td>
<td class="property_flags">Read / Write</td>
</tr>
@ -624,13 +624,13 @@
<a name="GtkFileChooser.signals"></a><h2>Signals</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="signals_return">
<col width="300px" class="signals_name">
<col width="200px" class="signals_flags">
<col width="150px" class="signal_proto_type">
<col width="300px" class="signal_proto_name">
<col width="200px" class="signal_proto_flags">
</colgroup>
<tbody>
<tr>
<td class="signal_type"><a class="link" href="GtkFileChooser.html#GtkFileChooserConfirmation" title="enum GtkFileChooserConfirmation"><span class="returnvalue">GtkFileChooserConfirmation</span></a></td>
<td class="signal_type"><a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GtkFileChooserConfirmation"><span class="returnvalue">GtkFileChooserConfirmation</span></a></td>
<td class="signal_name"><a class="link" href="GtkFileChooser.html#GtkFileChooser-confirm-overwrite" title="The “confirm-overwrite” signal">confirm-overwrite</a></td>
<td class="signal_flags">Run Last</td>
</tr>
@ -661,29 +661,29 @@
<a name="GtkFileChooser.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GtkFileChooser.html#GtkFileChooser-struct" title="GtkFileChooser">GtkFileChooser</a></td>
<td class="function_name"><a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GtkFileChooser-struct">GtkFileChooser</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="GtkFileChooser.html#GtkFileChooserAction" title="enum GtkFileChooserAction">GtkFileChooserAction</a></td>
<td class="function_name"><a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GtkFileChooserAction">GtkFileChooserAction</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="GtkFileChooser.html#GtkFileChooserConfirmation" title="enum GtkFileChooserConfirmation">GtkFileChooserConfirmation</a></td>
<td class="function_name"><a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GtkFileChooserConfirmation">GtkFileChooserConfirmation</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ERROR:CAPS" title="GTK_FILE_CHOOSER_ERROR">GTK_FILE_CHOOSER_ERROR</a></td>
<td class="function_name"><a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-ERROR:CAPS">GTK_FILE_CHOOSER_ERROR</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="GtkFileChooser.html#GtkFileChooserError" title="enum GtkFileChooserError">GtkFileChooserError</a></td>
<td class="function_name"><a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GtkFileChooserError">GtkFileChooserError</a></td>
</tr>
</tbody>
</table></div>
@ -808,39 +808,39 @@ generate a preview.</p>
31
32
33</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="cbracket">{</span>
<span class="normal"> </span><span class="usertype">GtkImage</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">preview</span><span class="symbol">;</span>
<td class="listing_code"><pre class="programlisting"><span class="p">{</span>
<span class="n">GtkImage</span> <span class="o">*</span><span class="n">preview</span><span class="p">;</span>
<span class="normal"> </span><span class="symbol">...</span>
<span class="p">...</span>
<span class="normal"> preview </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkImage.html#gtk-image-new">gtk_image_new</a></span><span class="normal"> </span><span class="symbol">();</span>
<span class="n">preview</span> <span class="o">=</span> <span class="n">gtk_image_new</span> <span class="p">();</span>
<span class="normal"> </span><span class="function"><a href="GtkFileChooser.html#gtk-file-chooser-set-preview-widget">gtk_file_chooser_set_preview_widget</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">my_file_chooser</span><span class="symbol">,</span><span class="normal"> preview</span><span class="symbol">);</span>
<span class="normal"> </span><span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">my_file_chooser</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"update-preview"</span><span class="symbol">,</span>
<span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">update_preview_cb</span><span class="symbol">),</span><span class="normal"> preview</span><span class="symbol">);</span>
<span class="cbracket">}</span>
<span class="n">gtk_file_chooser_set_preview_widget</span> <span class="p">(</span><span class="n">my_file_chooser</span><span class="p">,</span> <span class="n">preview</span><span class="p">);</span>
<span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">my_file_chooser</span><span class="p">,</span> <span class="s">&quot;update-preview&quot;</span><span class="p">,</span>
<span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">update_preview_cb</span><span class="p">),</span> <span class="n">preview</span><span class="p">);</span>
<span class="p">}</span>
<span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
<span class="function">update_preview_cb</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GtkFileChooser</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">file_chooser</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">gpointer</span><span class="normal"> data</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal"> </span><span class="usertype">GtkWidget</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">preview</span><span class="symbol">;</span>
<span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">filename</span><span class="symbol">;</span>
<span class="normal"> </span><span class="usertype">GdkPixbuf</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">pixbuf</span><span class="symbol">;</span>
<span class="normal"> </span><span class="usertype">gboolean</span><span class="normal"> have_preview</span><span class="symbol">;</span>
<span class="k">static</span> <span class="kt">void</span>
<span class="n">update_preview_cb</span> <span class="p">(</span><span class="n">GtkFileChooser</span> <span class="o">*</span><span class="n">file_chooser</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">GtkWidget</span> <span class="o">*</span><span class="n">preview</span><span class="p">;</span>
<span class="kt">char</span> <span class="o">*</span><span class="n">filename</span><span class="p">;</span>
<span class="n">GdkPixbuf</span> <span class="o">*</span><span class="n">pixbuf</span><span class="p">;</span>
<span class="n">gboolean</span> <span class="n">have_preview</span><span class="p">;</span>
<span class="normal"> preview </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">data</span><span class="symbol">);</span>
<span class="normal"> filename </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkFileChooser.html#gtk-file-chooser-get-preview-filename">gtk_file_chooser_get_preview_filename</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file_chooser</span><span class="symbol">);</span>
<span class="n">preview</span> <span class="o">=</span> <span class="n">GTK_WIDGET</span> <span class="p">(</span><span class="n">data</span><span class="p">);</span>
<span class="n">filename</span> <span class="o">=</span> <span class="n">gtk_file_chooser_get_preview_filename</span> <span class="p">(</span><span class="n">file_chooser</span><span class="p">);</span>
<span class="normal"> pixbuf </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gdk-pixbuf/unstable/gdk-pixbuf-File-Loading.html#gdk-pixbuf-new-from-file-at-size">gdk_pixbuf_new_from_file_at_size</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">filename</span><span class="symbol">,</span><span class="normal"> </span><span class="number">128</span><span class="symbol">,</span><span class="normal"> </span><span class="number">128</span><span class="symbol">,</span><span class="normal"> NULL</span><span class="symbol">);</span>
<span class="normal"> have_preview </span><span class="symbol">=</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">pixbuf </span><span class="symbol">!=</span><span class="normal"> NULL</span><span class="symbol">);</span>
<span class="normal"> </span><span class="function">g_free</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">filename</span><span class="symbol">);</span>
<span class="n">pixbuf</span> <span class="o">=</span> <span class="n">gdk_pixbuf_new_from_file_at_size</span> <span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="mi">128</span><span class="p">,</span> <span class="mi">128</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span>
<span class="n">have_preview</span> <span class="o">=</span> <span class="p">(</span><span class="n">pixbuf</span> <span class="o">!=</span> <span class="nb">NULL</span><span class="p">);</span>
<span class="n">g_free</span> <span class="p">(</span><span class="n">filename</span><span class="p">);</span>
<span class="normal"> </span><span class="function"><a href="GtkImage.html#gtk-image-set-from-pixbuf">gtk_image_set_from_pixbuf</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_IMAGE</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">preview</span><span class="symbol">),</span><span class="normal"> pixbuf</span><span class="symbol">);</span>
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">pixbuf</span><span class="symbol">)</span>
<span class="normal"> </span><span class="function">g_object_unref</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">pixbuf</span><span class="symbol">);</span>
<span class="n">gtk_image_set_from_pixbuf</span> <span class="p">(</span><span class="n">GTK_IMAGE</span> <span class="p">(</span><span class="n">preview</span><span class="p">),</span> <span class="n">pixbuf</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">pixbuf</span><span class="p">)</span>
<span class="n">g_object_unref</span> <span class="p">(</span><span class="n">pixbuf</span><span class="p">);</span>
<span class="normal"> </span><span class="function"><a href="GtkFileChooser.html#gtk-file-chooser-set-preview-widget-active">gtk_file_chooser_set_preview_widget_active</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">file_chooser</span><span class="symbol">,</span><span class="normal"> have_preview</span><span class="symbol">);</span>
<span class="cbracket">}</span></pre></td>
<span class="n">gtk_file_chooser_set_preview_widget_active</span> <span class="p">(</span><span class="n">file_chooser</span><span class="p">,</span> <span class="n">have_preview</span><span class="p">);</span>
<span class="p">}</span></pre></td>
</tr>
</tbody>
</table>
@ -871,14 +871,14 @@ widgets in a file chooser.</p>
6
7
8</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="usertype">GtkWidget</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">toggle</span><span class="symbol">;</span>
<td class="listing_code"><pre class="programlisting"><span class="n">GtkWidget</span> <span class="o">*</span><span class="n">toggle</span><span class="p">;</span>
<span class="symbol">...</span>
<span class="p">...</span>
<span class="normal">toggle </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkCheckButton.html#gtk-check-button-new-with-label">gtk_check_button_new_with_label</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Open file read-only"</span><span class="symbol">);</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">toggle</span><span class="symbol">);</span>
<span class="function"><a href="GtkFileChooser.html#gtk-file-chooser-set-extra-widget">gtk_file_chooser_set_extra_widget</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">my_file_chooser</span><span class="symbol">,</span><span class="normal"> toggle</span><span class="symbol">);</span>
<span class="cbracket">}</span></pre></td>
<span class="n">toggle</span> <span class="o">=</span> <span class="n">gtk_check_button_new_with_label</span> <span class="p">(</span><span class="s">&quot;Open file read-only&quot;</span><span class="p">);</span>
<span class="n">gtk_widget_show</span> <span class="p">(</span><span class="n">toggle</span><span class="p">);</span>
<span class="n">gtk_file_chooser_set_extra_widget</span> <span class="p">(</span><span class="n">my_file_chooser</span><span class="p">,</span> <span class="n">toggle</span><span class="p">);</span>
<span class="p">}</span></pre></td>
</tr>
</tbody>
</table>
@ -897,12 +897,12 @@ the whole extra widget.</p>
<a name="gtk-file-chooser-set-action"></a><h3>gtk_file_chooser_set_action ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_file_chooser_set_action (<em class="parameter"><code><a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a> *chooser</code></em>,
<em class="parameter"><code><a class="link" href="GtkFileChooser.html#GtkFileChooserAction" title="enum GtkFileChooserAction"><span class="type">GtkFileChooserAction</span></a> action</code></em>);</pre>
<em class="parameter"><code><a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GtkFileChooserAction"><span class="type">GtkFileChooserAction</span></a> action</code></em>);</pre>
<p>Sets the type of operation that the chooser is performing; the
user interface is adapted to suit the selected action. For example,
an option to create a new folder might be shown if the action is
<a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SAVE</code></a> but not if the action is
<a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-OPEN:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_OPEN</code></a>.</p>
<a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SAVE</code></a> but not if the action is
<a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-OPEN:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_OPEN</code></a>.</p>
<div class="refsect3">
<a name="gtk-file-chooser-set-action.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
@ -930,7 +930,7 @@ an option to create a new folder might be shown if the action is
<hr>
<div class="refsect2">
<a name="gtk-file-chooser-get-action"></a><h3>gtk_file_chooser_get_action ()</h3>
<pre class="programlisting"><a class="link" href="GtkFileChooser.html#GtkFileChooserAction" title="enum GtkFileChooserAction"><span class="returnvalue">GtkFileChooserAction</span></a>
<pre class="programlisting"><a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GtkFileChooserAction"><span class="returnvalue">GtkFileChooserAction</span></a>
gtk_file_chooser_get_action (<em class="parameter"><code><a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a> *chooser</code></em>);</pre>
<p>Gets the type of operation that the file chooser is performing; see
<a class="link" href="GtkFileChooser.html#gtk-file-chooser-set-action" title="gtk_file_chooser_set_action ()"><code class="function">gtk_file_chooser_set_action()</code></a>.</p>
@ -1033,8 +1033,8 @@ file selector. See <a class="link" href="GtkFileChooser.html#gtk-file-chooser-se
gtk_file_chooser_set_select_multiple (<em class="parameter"><code><a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a> *chooser</code></em>,
<em class="parameter"><code><span class="type">gboolean</span> select_multiple</code></em>);</pre>
<p>Sets whether multiple files can be selected in the file selector. This is
only relevant if the action is set to be <a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-OPEN:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_OPEN</code></a> or
<a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SELECT-FOLDER:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</code></a>.</p>
only relevant if the action is set to be <a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-OPEN:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_OPEN</code></a> or
<a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SELECT-FOLDER:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</code></a>.</p>
<div class="refsect3">
<a name="gtk-file-chooser-set-select-multiple.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
@ -1153,7 +1153,7 @@ See <a class="link" href="GtkFileChooser.html#gtk-file-chooser-set-show-hidden"
gtk_file_chooser_set_do_overwrite_confirmation
(<em class="parameter"><code><a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a> *chooser</code></em>,
<em class="parameter"><code><span class="type">gboolean</span> do_overwrite_confirmation</code></em>);</pre>
<p>Sets whether a file chooser in <a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SAVE</code></a> mode will present
<p>Sets whether a file chooser in <a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SAVE</code></a> mode will present
a confirmation dialog if the user types a file name that already exists. This
is <code class="literal">FALSE</code> by default.</p>
<p>If set to <code class="literal">TRUE</code>, the <em class="parameter"><code>chooser</code></em>
@ -1225,7 +1225,7 @@ gtk_file_chooser_set_create_folders (<em class="parameter"><code><a class="link"
<em class="parameter"><code><span class="type">gboolean</span> create_folders</code></em>);</pre>
<p>Sets whether file choser will offer to create new folders.
This is only relevant if the action is not set to be
<a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-OPEN:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_OPEN</code></a>.</p>
<a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-OPEN:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_OPEN</code></a>.</p>
<div class="refsect3">
<a name="gtk-file-chooser-set-create-folders.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
@ -1400,7 +1400,7 @@ gtk_file_chooser_set_filename (<em class="parameter"><code><a class="link" href=
the files parent folder and actually selecting the file in list; all other
files will be unselected. If the <em class="parameter"><code>chooser</code></em>
is in
<a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SAVE</code></a> mode, the files base name will also appear in
<a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SAVE</code></a> mode, the files base name will also appear in
the dialogs file name entry.</p>
<p>Note that the file must exist, or nothing will be done except
for the directory change.</p>
@ -1425,16 +1425,16 @@ time, do not call this function. Instead, use something similar to this:</p>
8
9
10</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">document_is_new</span><span class="symbol">)</span>
<span class="normal"> </span><span class="cbracket">{</span>
<span class="normal"> </span><span class="comment">// the user just created a new document</span>
<span class="normal"> </span><span class="function"><a href="GtkFileChooser.html#gtk-file-chooser-set-current-name">gtk_file_chooser_set_current_name</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">chooser</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Untitled document"</span><span class="symbol">);</span>
<span class="normal"> </span><span class="cbracket">}</span>
<span class="keyword">else</span>
<span class="normal"> </span><span class="cbracket">{</span>
<span class="normal"> </span><span class="comment">// the user edited an existing document</span>
<span class="normal"> </span><span class="function"><a href="GtkFileChooser.html#gtk-file-chooser-set-filename">gtk_file_chooser_set_filename</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">chooser</span><span class="symbol">,</span><span class="normal"> existing_filename</span><span class="symbol">);</span>
<span class="normal"> </span><span class="cbracket">}</span></pre></td>
<td class="listing_code"><pre class="programlisting"><span class="k">if</span> <span class="p">(</span><span class="n">document_is_new</span><span class="p">)</span>
<span class="p">{</span>
<span class="c1">// the user just created a new document</span>
<span class="n">gtk_file_chooser_set_current_name</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="s">&quot;Untitled document&quot;</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">else</span>
<span class="p">{</span>
<span class="c1">// the user edited an existing document</span>
<span class="n">gtk_file_chooser_set_filename</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">existing_filename</span><span class="p">);</span>
<span class="p">}</span></pre></td>
</tr>
</tbody>
</table>
@ -1679,7 +1679,7 @@ See <a class="link" href="GtkFileChooser.html#gtk-file-chooser-set-current-folde
<p>Note that this is the folder that the file chooser is currently displaying
(e.g. "/home/username/Documents"), which is not the same
as the currently-selected folder if the chooser is in
<a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SELECT-FOLDER:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</code></a> mode
<a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SELECT-FOLDER:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</code></a> mode
(e.g. "/home/username/Documents/selected-folder/". To get the
currently-selected folder in that mode, use <a class="link" href="GtkFileChooser.html#gtk-file-chooser-get-uri" title="gtk_file_chooser_get_uri ()"><code class="function">gtk_file_chooser_get_uri()</code></a> as the
usual way to get the selection.</p>
@ -1755,7 +1755,7 @@ gtk_file_chooser_set_uri (<em class="parameter"><code><a class="link" href="GtkF
as the current file for the file chooser,
by changing to the URIs parent folder and actually selecting the URI in the
list. If the <em class="parameter"><code>chooser</code></em>
is <a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SAVE</code></a> mode, the URIs base
is <a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SAVE</code></a> mode, the URIs base
name will also appear in the dialogs file name entry.</p>
<p>Note that the URI must exist, or nothing will be done except for the
directory change.</p>
@ -1780,16 +1780,16 @@ not call this function. Instead, use something similar to this:</p>
8
9
10</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">document_is_new</span><span class="symbol">)</span>
<span class="normal"> </span><span class="cbracket">{</span>
<span class="normal"> </span><span class="comment">// the user just created a new document</span>
<span class="normal"> </span><span class="function"><a href="GtkFileChooser.html#gtk-file-chooser-set-current-name">gtk_file_chooser_set_current_name</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">chooser</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Untitled document"</span><span class="symbol">);</span>
<span class="normal"> </span><span class="cbracket">}</span>
<span class="keyword">else</span>
<span class="normal"> </span><span class="cbracket">{</span>
<span class="normal"> </span><span class="comment">// the user edited an existing document</span>
<span class="normal"> </span><span class="function"><a href="GtkFileChooser.html#gtk-file-chooser-set-uri">gtk_file_chooser_set_uri</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">chooser</span><span class="symbol">,</span><span class="normal"> existing_uri</span><span class="symbol">);</span>
<span class="normal"> </span><span class="cbracket">}</span></pre></td>
<td class="listing_code"><pre class="programlisting"><span class="k">if</span> <span class="p">(</span><span class="n">document_is_new</span><span class="p">)</span>
<span class="p">{</span>
<span class="c1">// the user just created a new document</span>
<span class="n">gtk_file_chooser_set_current_name</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="s">&quot;Untitled document&quot;</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">else</span>
<span class="p">{</span>
<span class="c1">// the user edited an existing document</span>
<span class="n">gtk_file_chooser_set_uri</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">existing_uri</span><span class="p">);</span>
<span class="p">}</span></pre></td>
</tr>
</tbody>
</table>
@ -1989,7 +1989,7 @@ See <a class="link" href="GtkFileChooser.html#gtk-file-chooser-set-current-folde
<p>Note that this is the folder that the file chooser is currently displaying
(e.g. "file:///home/username/Documents"), which is not the same
as the currently-selected folder if the chooser is in
<a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SELECT-FOLDER:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</code></a> mode
<a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SELECT-FOLDER:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</code></a> mode
(e.g. "file:///home/username/Documents/selected-folder/". To get the
currently-selected folder in that mode, use <a class="link" href="GtkFileChooser.html#gtk-file-chooser-get-uri" title="gtk_file_chooser_get_uri ()"><code class="function">gtk_file_chooser_get_uri()</code></a> as the
usual way to get the selection.</p>
@ -3142,7 +3142,7 @@ gtk_file_chooser_set_file (<em class="parameter"><code><a class="link" href="Gtk
as the current filename for the file chooser, by changing
to the files parent folder and actually selecting the file in list. If
the <em class="parameter"><code>chooser</code></em>
is in <a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SAVE</code></a> mode, the files base name
is in <a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SAVE</code></a> mode, the files base name
will also appear in the dialogs file name entry.</p>
<p>If the file name isnt in the current folder of <em class="parameter"><code>chooser</code></em>
, then the current
@ -3175,17 +3175,17 @@ Instead, use something similar to this:</p>
9
10
11</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">document_is_new</span><span class="symbol">)</span>
<span class="normal"> </span><span class="cbracket">{</span>
<span class="normal"> </span><span class="comment">// the user just created a new document</span>
<span class="normal"> </span><span class="function"><a href="GtkFileChooser.html#gtk-file-chooser-set-current-folder-file">gtk_file_chooser_set_current_folder_file</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">chooser</span><span class="symbol">,</span><span class="normal"> default_file_for_saving</span><span class="symbol">);</span>
<span class="normal"> </span><span class="function"><a href="GtkFileChooser.html#gtk-file-chooser-set-current-name">gtk_file_chooser_set_current_name</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">chooser</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Untitled document"</span><span class="symbol">);</span>
<span class="normal"> </span><span class="cbracket">}</span>
<span class="keyword">else</span>
<span class="normal"> </span><span class="cbracket">{</span>
<span class="normal"> </span><span class="comment">// the user edited an existing document</span>
<span class="normal"> </span><span class="function"><a href="GtkFileChooser.html#gtk-file-chooser-set-file">gtk_file_chooser_set_file</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">chooser</span><span class="symbol">,</span><span class="normal"> existing_file</span><span class="symbol">);</span>
<span class="normal"> </span><span class="cbracket">}</span></pre></td>
<td class="listing_code"><pre class="programlisting"><span class="k">if</span> <span class="p">(</span><span class="n">document_is_new</span><span class="p">)</span>
<span class="p">{</span>
<span class="c1">// the user just created a new document</span>
<span class="n">gtk_file_chooser_set_current_folder_file</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">default_file_for_saving</span><span class="p">);</span>
<span class="n">gtk_file_chooser_set_current_name</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="s">&quot;Untitled document&quot;</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">else</span>
<span class="p">{</span>
<span class="c1">// the user edited an existing document</span>
<span class="n">gtk_file_chooser_set_file</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="n">existing_file</span><span class="p">);</span>
<span class="p">}</span></pre></td>
</tr>
</tbody>
</table>
@ -3260,171 +3260,12 @@ directory, does not exist, or is otherwise not currently selected, does nothing.
</div>
</div>
<div class="refsect1">
<a name="GtkFileChooser.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GtkFileChooser-struct"></a><h3>GtkFileChooser</h3>
<pre class="programlisting">typedef struct _GtkFileChooser GtkFileChooser;</pre>
</div>
<hr>
<div class="refsect2">
<a name="GtkFileChooserAction"></a><h3>enum GtkFileChooserAction</h3>
<p>Describes whether a <a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a> is being used to open existing files
or to save to a possibly new file.</p>
<div class="refsect3">
<a name="GtkFileChooserAction.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GTK-FILE-CHOOSER-ACTION-OPEN:CAPS"></a>GTK_FILE_CHOOSER_ACTION_OPEN</p></td>
<td class="enum_member_description">
<p>Indicates open mode. The file chooser
will only let the user pick an existing file.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"></a>GTK_FILE_CHOOSER_ACTION_SAVE</p></td>
<td class="enum_member_description">
<p>Indicates save mode. The file chooser
will let the user pick an existing file, or type in a new
filename.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-FILE-CHOOSER-ACTION-SELECT-FOLDER:CAPS"></a>GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</p></td>
<td class="enum_member_description">
<p>Indicates an Open mode for
selecting folders. The file chooser will let the user pick an
existing folder.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-FILE-CHOOSER-ACTION-CREATE-FOLDER:CAPS"></a>GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER</p></td>
<td class="enum_member_description">
<p>Indicates a mode for creating a
new folder. The file chooser will let the user name an existing or
new folder.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GtkFileChooserConfirmation"></a><h3>enum GtkFileChooserConfirmation</h3>
<p>Used as a return value of handlers for the
<a class="link" href="GtkFileChooser.html#GtkFileChooser-confirm-overwrite" title="The “confirm-overwrite” signal"><span class="type">“confirm-overwrite”</span></a> signal of a <a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a>. This
value determines whether the file chooser will present the stock
confirmation dialog, accept the users choice of a filename, or
let the user choose another filename.</p>
<div class="refsect3">
<a name="GtkFileChooserConfirmation.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GTK-FILE-CHOOSER-CONFIRMATION-CONFIRM:CAPS"></a>GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM</p></td>
<td class="enum_member_description">
<p>The file chooser will present
its stock dialog to confirm about overwriting an existing file.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-FILE-CHOOSER-CONFIRMATION-ACCEPT-FILENAME:CAPS"></a>GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME</p></td>
<td class="enum_member_description">
<p>The file chooser will
terminate and accept the users choice of a file name.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-FILE-CHOOSER-CONFIRMATION-SELECT-AGAIN:CAPS"></a>GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN</p></td>
<td class="enum_member_description">
<p>The file chooser will
continue running, so as to let the user select another file name.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.8</p>
</div>
<hr>
<div class="refsect2">
<a name="GTK-FILE-CHOOSER-ERROR:CAPS"></a><h3>GTK_FILE_CHOOSER_ERROR</h3>
<pre class="programlisting">#define GTK_FILE_CHOOSER_ERROR (gtk_file_chooser_error_quark ())
</pre>
<p>Used to get the <span class="type">GError</span> quark for <a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a> errors.</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkFileChooserError"></a><h3>enum GtkFileChooserError</h3>
<p>These identify the various errors that can occur while calling
<a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a> functions.</p>
<div class="refsect3">
<a name="GtkFileChooserError.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GTK-FILE-CHOOSER-ERROR-NONEXISTENT:CAPS"></a>GTK_FILE_CHOOSER_ERROR_NONEXISTENT</p></td>
<td class="enum_member_description">
<p>Indicates that a file does not exist.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-FILE-CHOOSER-ERROR-BAD-FILENAME:CAPS"></a>GTK_FILE_CHOOSER_ERROR_BAD_FILENAME</p></td>
<td class="enum_member_description">
<p>Indicates a malformed filename.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-FILE-CHOOSER-ERROR-ALREADY-EXISTS:CAPS"></a>GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS</p></td>
<td class="enum_member_description">
<p>Indicates a duplicate path (e.g. when
adding a bookmark).</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GTK-FILE-CHOOSER-ERROR-INCOMPLETE-HOSTNAME:CAPS"></a>GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME</p></td>
<td class="enum_member_description">
<p>Indicates an incomplete hostname (e.g. "http://foo" without a slash after that).</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="GtkFileChooser.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GtkFileChooser--action"></a><h3>The <code class="literal">“action”</code> property</h3>
<pre class="programlisting"> “action” <a class="link" href="GtkFileChooser.html#GtkFileChooserAction" title="enum GtkFileChooserAction"><span class="type">GtkFileChooserAction</span></a></pre>
<pre class="programlisting"> “action” <a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GtkFileChooserAction"><span class="type">GtkFileChooserAction</span></a></pre>
<p>The type of operation that the file selector is performing.</p>
<p>Owner: GtkFileChooser</p>
<p>Flags: Read / Write</p>
<p>Default value: GTK_FILE_CHOOSER_ACTION_OPEN</p>
</div>
@ -3432,8 +3273,9 @@ let the user choose another filename.</p>
<div class="refsect2">
<a name="GtkFileChooser--create-folders"></a><h3>The <code class="literal">“create-folders”</code> property</h3>
<pre class="programlisting"> “create-folders” <span class="type">gboolean</span></pre>
<p>Whether a file chooser not in <a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-OPEN:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_OPEN</code></a> mode
<p>Whether a file chooser not in <a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-OPEN:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_OPEN</code></a> mode
will offer the user to create new folders.</p>
<p>Owner: GtkFileChooser</p>
<p>Flags: Read / Write</p>
<p>Default value: TRUE</p>
<p class="since">Since: 2.18</p>
@ -3442,9 +3284,10 @@ will offer the user to create new folders.</p>
<div class="refsect2">
<a name="GtkFileChooser--do-overwrite-confirmation"></a><h3>The <code class="literal">“do-overwrite-confirmation”</code> property</h3>
<pre class="programlisting"> “do-overwrite-confirmation” <span class="type">gboolean</span></pre>
<p>Whether a file chooser in <a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SAVE</code></a> mode
<p>Whether a file chooser in <a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SAVE</code></a> mode
will present an overwrite confirmation dialog if the user
selects a file name that already exists.</p>
<p>Owner: GtkFileChooser</p>
<p>Flags: Read / Write</p>
<p>Default value: FALSE</p>
<p class="since">Since: 2.8</p>
@ -3454,6 +3297,7 @@ selects a file name that already exists.</p>
<a name="GtkFileChooser--extra-widget"></a><h3>The <code class="literal">“extra-widget”</code> property</h3>
<pre class="programlisting"> “extra-widget” <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *</pre>
<p>Application supplied widget for extra options.</p>
<p>Owner: GtkFileChooser</p>
<p>Flags: Read / Write</p>
</div>
<hr>
@ -3461,6 +3305,7 @@ selects a file name that already exists.</p>
<a name="GtkFileChooser--filter"></a><h3>The <code class="literal">“filter”</code> property</h3>
<pre class="programlisting"> “filter” <a class="link" href="GtkFileFilter.html" title="GtkFileFilter"><span class="type">GtkFileFilter</span></a> *</pre>
<p>The current filter for selecting which files are displayed.</p>
<p>Owner: GtkFileChooser</p>
<p>Flags: Read / Write</p>
</div>
<hr>
@ -3468,6 +3313,7 @@ selects a file name that already exists.</p>
<a name="GtkFileChooser--local-only"></a><h3>The <code class="literal">“local-only”</code> property</h3>
<pre class="programlisting"> “local-only” <span class="type">gboolean</span></pre>
<p>Whether the selected file(s) should be limited to local file: URLs.</p>
<p>Owner: GtkFileChooser</p>
<p>Flags: Read / Write</p>
<p>Default value: TRUE</p>
</div>
@ -3476,6 +3322,7 @@ selects a file name that already exists.</p>
<a name="GtkFileChooser--preview-widget"></a><h3>The <code class="literal">“preview-widget”</code> property</h3>
<pre class="programlisting"> “preview-widget” <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *</pre>
<p>Application supplied widget for custom previews.</p>
<p>Owner: GtkFileChooser</p>
<p>Flags: Read / Write</p>
</div>
<hr>
@ -3483,6 +3330,7 @@ selects a file name that already exists.</p>
<a name="GtkFileChooser--preview-widget-active"></a><h3>The <code class="literal">“preview-widget-active”</code> property</h3>
<pre class="programlisting"> “preview-widget-active” <span class="type">gboolean</span></pre>
<p>Whether the application supplied widget for custom previews should be shown.</p>
<p>Owner: GtkFileChooser</p>
<p>Flags: Read / Write</p>
<p>Default value: TRUE</p>
</div>
@ -3491,6 +3339,7 @@ selects a file name that already exists.</p>
<a name="GtkFileChooser--select-multiple"></a><h3>The <code class="literal">“select-multiple”</code> property</h3>
<pre class="programlisting"> “select-multiple” <span class="type">gboolean</span></pre>
<p>Whether to allow multiple files to be selected.</p>
<p>Owner: GtkFileChooser</p>
<p>Flags: Read / Write</p>
<p>Default value: FALSE</p>
</div>
@ -3499,6 +3348,7 @@ selects a file name that already exists.</p>
<a name="GtkFileChooser--show-hidden"></a><h3>The <code class="literal">“show-hidden”</code> property</h3>
<pre class="programlisting"> “show-hidden” <span class="type">gboolean</span></pre>
<p>Whether the hidden files and folders should be displayed.</p>
<p>Owner: GtkFileChooser</p>
<p>Flags: Read / Write</p>
<p>Default value: FALSE</p>
</div>
@ -3507,6 +3357,7 @@ selects a file name that already exists.</p>
<a name="GtkFileChooser--use-preview-label"></a><h3>The <code class="literal">“use-preview-label”</code> property</h3>
<pre class="programlisting"> “use-preview-label” <span class="type">gboolean</span></pre>
<p>Whether to display a stock label with the name of the previewed file.</p>
<p>Owner: GtkFileChooser</p>
<p>Flags: Read / Write</p>
<p>Default value: TRUE</p>
</div>
@ -3515,13 +3366,13 @@ selects a file name that already exists.</p>
<a name="GtkFileChooser.signal-details"></a><h2>Signal Details</h2>
<div class="refsect2">
<a name="GtkFileChooser-confirm-overwrite"></a><h3>The <code class="literal">“confirm-overwrite”</code> signal</h3>
<pre class="programlisting"><a class="link" href="GtkFileChooser.html#GtkFileChooserConfirmation" title="enum GtkFileChooserConfirmation"><span class="returnvalue">GtkFileChooserConfirmation</span></a>
<pre class="programlisting"><a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GtkFileChooserConfirmation"><span class="returnvalue">GtkFileChooserConfirmation</span></a>
user_function (<a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a> *chooser,
<span class="type">gpointer</span> user_data)</pre>
<p>This signal gets emitted whenever it is appropriate to present a
confirmation dialog when the user has selected a file name that
already exists. The signal only gets emitted when the file
chooser is in <a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SAVE</code></a> mode.</p>
chooser is in <a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SAVE:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SAVE</code></a> mode.</p>
<p>Most applications just need to turn on the
<a class="link" href="GtkFileChooser.html#GtkFileChooser--do-overwrite-confirmation" title="The “do-overwrite-confirmation” property"><span class="type">“do-overwrite-confirmation”</span></a> property (or call the
<a class="link" href="GtkFileChooser.html#gtk-file-chooser-set-do-overwrite-confirmation" title="gtk_file_chooser_set_do_overwrite_confirmation ()"><code class="function">gtk_file_chooser_set_do_overwrite_confirmation()</code></a> function), and
@ -3530,15 +3381,15 @@ Applications which need to customize this behavior should do
that, and also connect to the <a class="link" href="GtkFileChooser.html#GtkFileChooser-confirm-overwrite" title="The “confirm-overwrite” signal"><span class="type">“confirm-overwrite”</span></a>
signal.</p>
<p>A signal handler for this signal must return a
<a class="link" href="GtkFileChooser.html#GtkFileChooserConfirmation" title="enum GtkFileChooserConfirmation"><span class="type">GtkFileChooserConfirmation</span></a> value, which indicates the action to
<a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GtkFileChooserConfirmation"><span class="type">GtkFileChooserConfirmation</span></a> value, which indicates the action to
take. If the handler determines that the user wants to select a
different filename, it should return
<a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-CONFIRMATION-SELECT-AGAIN:CAPS"><code class="literal">GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN</code></a>. If it determines
<a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-CONFIRMATION-SELECT-AGAIN:CAPS"><code class="literal">GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN</code></a>. If it determines
that the user is satisfied with his choice of file name, it
should return <a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-CONFIRMATION-ACCEPT-FILENAME:CAPS"><code class="literal">GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME</code></a>.
should return <a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-CONFIRMATION-ACCEPT-FILENAME:CAPS"><code class="literal">GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME</code></a>.
On the other hand, if it determines that the stock confirmation
dialog should be used, it should return
<a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-CONFIRMATION-CONFIRM:CAPS"><code class="literal">GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM</code></a>. The following example
<a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GTK-FILE-CHOOSER-CONFIRMATION-CONFIRM:CAPS"><code class="literal">GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM</code></a>. The following example
illustrates this.</p>
<div class="refsect3">
<a name="gtkfilechooser-confirmation"></a><h4>Custom confirmation</h4>
@ -3575,35 +3426,35 @@ illustrates this.</p>
27
28
29</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="keyword">static</span><span class="normal"> <a href="GtkFileChooser.html#GtkFileChooserConfirmation">GtkFileChooserConfirmation</a></span>
<span class="function">confirm_overwrite_callback</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GtkFileChooser</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">chooser</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">gpointer</span><span class="normal"> data</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">uri</span><span class="symbol">;</span>
<td class="listing_code"><pre class="programlisting"><span class="k">static</span> <span class="n">GtkFileChooserConfirmation</span>
<span class="nf">confirm_overwrite_callback</span> <span class="p">(</span><span class="n">GtkFileChooser</span> <span class="o">*</span><span class="n">chooser</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">data</span><span class="p">)</span>
<span class="p">{</span>
<span class="kt">char</span> <span class="o">*</span><span class="n">uri</span><span class="p">;</span>
<span class="normal"> uri </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkFileChooser.html#gtk-file-chooser-get-uri">gtk_file_chooser_get_uri</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">chooser</span><span class="symbol">);</span>
<span class="n">uri</span> <span class="o">=</span> <span class="n">gtk_file_chooser_get_uri</span> <span class="p">(</span><span class="n">chooser</span><span class="p">);</span>
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="function">is_uri_read_only</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">uri</span><span class="symbol">))</span>
<span class="normal"> </span><span class="cbracket">{</span>
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="function">user_wants_to_replace_read_only_file</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">uri</span><span class="symbol">))</span>
<span class="normal"> </span><span class="keyword">return</span><span class="normal"> <a href="GtkFileChooser.html#GTK-FILE-CHOOSER-CONFIRMATION-ACCEPT-FILENAME:CAPS">GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME</a></span><span class="symbol">;</span>
<span class="normal"> </span><span class="keyword">else</span>
<span class="normal"> </span><span class="keyword">return</span><span class="normal"> <a href="GtkFileChooser.html#GTK-FILE-CHOOSER-CONFIRMATION-SELECT-AGAIN:CAPS">GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN</a></span><span class="symbol">;</span>
<span class="normal"> </span><span class="cbracket">}</span><span class="normal"> </span><span class="keyword">else</span>
<span class="normal"> </span><span class="keyword">return</span><span class="normal"> <a href="GtkFileChooser.html#GTK-FILE-CHOOSER-CONFIRMATION-CONFIRM:CAPS">GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM</a></span><span class="symbol">;</span><span class="normal"> </span><span class="comment">// fall back to the default dialog</span>
<span class="cbracket">}</span>
<span class="k">if</span> <span class="p">(</span><span class="n">is_uri_read_only</span> <span class="p">(</span><span class="n">uri</span><span class="p">))</span>
<span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="n">user_wants_to_replace_read_only_file</span> <span class="p">(</span><span class="n">uri</span><span class="p">))</span>
<span class="k">return</span> <span class="n">GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME</span><span class="p">;</span>
<span class="k">else</span>
<span class="k">return</span> <span class="n">GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN</span><span class="p">;</span>
<span class="p">}</span> <span class="k">else</span>
<span class="k">return</span> <span class="n">GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM</span><span class="p">;</span> <span class="c1">// fall back to the default dialog</span>
<span class="p">}</span>
<span class="symbol">...</span>
<span class="p">...</span>
<span class="normal">chooser </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkFileChooserDialog.html#gtk-file-chooser-dialog-new">gtk_file_chooser_dialog_new</a></span><span class="normal"> </span><span class="symbol">(...);</span>
<span class="n">chooser</span> <span class="o">=</span> <span class="n">gtk_file_chooser_dialog_new</span> <span class="p">(...);</span>
<span class="function"><a href="GtkFileChooser.html#gtk-file-chooser-set-do-overwrite-confirmation">gtk_file_chooser_set_do_overwrite_confirmation</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_FILE_CHOOSER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">dialog</span><span class="symbol">),</span><span class="normal"> TRUE</span><span class="symbol">);</span>
<span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">chooser</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"confirm-overwrite"</span><span class="symbol">,</span>
<span class="normal"> </span><span class="function">G_CALLBACK</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">confirm_overwrite_callback</span><span class="symbol">),</span><span class="normal"> NULL</span><span class="symbol">);</span>
<span class="n">gtk_file_chooser_set_do_overwrite_confirmation</span> <span class="p">(</span><span class="n">GTK_FILE_CHOOSER</span> <span class="p">(</span><span class="n">dialog</span><span class="p">),</span> <span class="n">TRUE</span><span class="p">);</span>
<span class="n">g_signal_connect</span> <span class="p">(</span><span class="n">chooser</span><span class="p">,</span> <span class="s">&quot;confirm-overwrite&quot;</span><span class="p">,</span>
<span class="n">G_CALLBACK</span> <span class="p">(</span><span class="n">confirm_overwrite_callback</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">);</span>
<span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="GtkDialog.html#gtk-dialog-run">gtk_dialog_run</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">chooser</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">==</span><span class="normal"> <a href="GtkDialog.html#GTK-RESPONSE-ACCEPT:CAPS">GTK_RESPONSE_ACCEPT</a></span><span class="symbol">)</span>
<span class="normal"> </span><span class="function">save_to_file</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="GtkFileChooser.html#gtk-file-chooser-get-filename">gtk_file_chooser_get_filename</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_FILE_CHOOSER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">chooser</span><span class="symbol">));</span>
<span class="k">if</span> <span class="p">(</span><span class="n">gtk_dialog_run</span> <span class="p">(</span><span class="n">chooser</span><span class="p">)</span> <span class="o">==</span> <span class="n">GTK_RESPONSE_ACCEPT</span><span class="p">)</span>
<span class="n">save_to_file</span> <span class="p">(</span><span class="n">gtk_file_chooser_get_filename</span> <span class="p">(</span><span class="n">GTK_FILE_CHOOSER</span> <span class="p">(</span><span class="n">chooser</span><span class="p">));</span>
<span class="function"><a href="GtkWidget.html#gtk-widget-destroy">gtk_widget_destroy</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">chooser</span><span class="symbol">);</span></pre></td>
<span class="n">gtk_widget_destroy</span> <span class="p">(</span><span class="n">chooser</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
@ -3635,7 +3486,7 @@ illustrates this.</p>
</div>
<div class="refsect3">
<a name="GtkFileChooser-confirm-overwrite.returns"></a><h4>Returns</h4>
<p> a <a class="link" href="GtkFileChooser.html#GtkFileChooserConfirmation" title="enum GtkFileChooserConfirmation"><span class="type">GtkFileChooserConfirmation</span></a> value that indicates which
<p> a <a href="https://developer.gnome.org/gtk4/GtkFileChooser.html#GtkFileChooserConfirmation"><span class="type">GtkFileChooserConfirmation</span></a> value that indicates which
action to take after emitting the signal.</p>
</div>
<p>Flags: Run Last</p>
@ -3819,6 +3670,6 @@ chooser about whether the preview was generated successfully or not.</p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.29</div>
<hr>Generated by GTK-Doc V1.32.1</div>
</body>
</html>