📄 gtkfilechooser.html
字号:
<hr><div class="refsect2" lang="en"><a name="id4013407"></a><h3><a name="GtkFileChooserError"></a>enum GtkFileChooserError</h3><a class="indexterm" name="id4013420"></a><pre class="programlisting">typedef enum { GTK_FILE_CHOOSER_ERROR_NONEXISTENT, GTK_FILE_CHOOSER_ERROR_BAD_FILENAME, GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS} GtkFileChooserError;</pre><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="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><a name="GTK-FILE-CHOOSER-ERROR-NONEXISTENT:CAPS"></a><code class="literal">GTK_FILE_CHOOSER_ERROR_NONEXISTENT</code></span></p></td><td>Indicates that a file does not exist.</td></tr><tr><td><p><span class="term"><a name="GTK-FILE-CHOOSER-ERROR-BAD-FILENAME:CAPS"></a><code class="literal">GTK_FILE_CHOOSER_ERROR_BAD_FILENAME</code></span></p></td><td>Indicates a malformed filename.</td></tr><tr><td><p><span class="term"><a name="GTK-FILE-CHOOSER-ERROR-ALREADY-EXISTS:CAPS"></a><code class="literal">GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS</code></span></p></td><td>Indicates a duplicate path (e.g. when adding a bookmark).</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4013523"></a><h3><a name="gtk-file-chooser-set-action"></a>gtk_file_chooser_set_action ()</h3><a class="indexterm" name="id4013538"></a><pre class="programlisting">void gtk_file_chooser_set_action (<a class="link" href="GtkFileChooser.html" title="GtkFileChooser">GtkFileChooser</a> *chooser, <a class="link" href="GtkFileChooser.html#GtkFileChooserAction">GtkFileChooserAction</a> action);</pre><p>Sets the type of operation that the chooser is performing; theuser 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><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>chooser</code></em> :</span></p></td><td> a <a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>action</code></em> :</span></p></td><td> the action that the file selector is performing</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id4013654"></a><h3><a name="gtk-file-chooser-get-action"></a>gtk_file_chooser_get_action ()</h3><a class="indexterm" name="id4013671"></a><pre class="programlisting"><a class="link" href="GtkFileChooser.html#GtkFileChooserAction">GtkFileChooserAction</a> gtk_file_chooser_get_action (<a class="link" href="GtkFileChooser.html" title="GtkFileChooser">GtkFileChooser</a> *chooser);</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"><code class="function">gtk_file_chooser_set_action()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>chooser</code></em> :</span></p></td><td> a <a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the action that the file selector is performing</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id4013759"></a><h3><a name="gtk-file-chooser-set-local-only"></a>gtk_file_chooser_set_local_only ()</h3><a class="indexterm" name="id4013775"></a><pre class="programlisting">void gtk_file_chooser_set_local_only (<a class="link" href="GtkFileChooser.html" title="GtkFileChooser">GtkFileChooser</a> *chooser, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> local_only);</pre><p>Sets whether only local files can be selected in thefile selector. If <em class="parameter"><code>local_only</code></em> is <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> (the default),then the selected file are files are guaranteed to beaccessible through the operating systems native filefile system and therefore the application onlyneeds to worry about the filename functions in<a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a>, like <a class="link" href="GtkFileChooser.html#gtk-file-chooser-get-filename"><code class="function">gtk_file_chooser_get_filename()</code></a>,rather than the URI functions like<a class="link" href="GtkFileChooser.html#gtk-file-chooser-get-uri"><code class="function">gtk_file_chooser_get_uri()</code></a>,</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>chooser</code></em> :</span></p></td><td> a <a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>local_only</code></em> :</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if only local files can be selected</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id4013924"></a><h3><a name="gtk-file-chooser-get-local-only"></a>gtk_file_chooser_get_local_only ()</h3><a class="indexterm" name="id4013940"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> gtk_file_chooser_get_local_only (<a class="link" href="GtkFileChooser.html" title="GtkFileChooser">GtkFileChooser</a> *chooser);</pre><p>Gets whether only local files can be selected in thefile selector. See <a class="link" href="GtkFileChooser.html#gtk-file-chooser-set-local-only"><code class="function">gtk_file_chooser_set_local_only()</code></a></p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>chooser</code></em> :</span></p></td><td> a <span class="type">GtkFileChoosre</span></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if only local files can be selected.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id4014039"></a><h3><a name="gtk-file-chooser-set-select-multiple"></a>gtk_file_chooser_set_select_multiple ()</h3><a class="indexterm" name="id4014055"></a><pre class="programlisting">void gtk_file_chooser_set_select_multiple (<a class="link" href="GtkFileChooser.html" title="GtkFileChooser">GtkFileChooser</a> *chooser, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> select_multiple);</pre><p>Sets whether multiple files can be selected in the file selector. This isonly relevant if the action is set to be GTK_FILE_CHOOSER_ACTION_OPEN orGTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>chooser</code></em> :</span></p></td><td> a <a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>select_multiple</code></em> :</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if multiple files can be selected.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id4014157"></a><h3><a name="gtk-file-chooser-get-select-multiple"></a>gtk_file_chooser_get_select_multiple ()</h3><a class="indexterm" name="id4014173"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> gtk_file_chooser_get_select_multiple (<a class="link" href="GtkFileChooser.html" title="GtkFileChooser">GtkFileChooser</a> *chooser);</pre><p>Gets whether multiple files can be selected in the fileselector. See <a class="link" href="GtkFileChooser.html#gtk-file-chooser-set-select-multiple"><code class="function">gtk_file_chooser_set_select_multiple()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>chooser</code></em> :</span></p></td><td> a <a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if multiple files can be selected.</td></tr></tbody></tabl
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -