📄 gtkfileselection.html
字号:
GtkWidget *selection_text; GtkWidget *main_vbox; GtkWidget *ok_button; GtkWidget *cancel_button; GtkWidget *help_button; GtkWidget *history_pulldown; GtkWidget *history_menu; GList *history_list; GtkWidget *fileop_dialog; GtkWidget *fileop_entry; gchar *fileop_file; gpointer cmpl_state; GtkWidget *fileop_c_dir; GtkWidget *fileop_del_file; GtkWidget *fileop_ren_file; GtkWidget *button_area; GtkWidget *action_area;} GtkFileSelection;</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">GtkFileSelection</code> is deprecated and should not be used in newly-written code.</p></div><p>The <a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a> struct contains the following <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> fields:</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>dir_list</code></em>;</span></p></td><td></td></tr><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>file_list</code></em>;</span></p></td><td></td></tr><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>selection_entry</code></em>;</span></p></td><td></td></tr><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>selection_text</code></em>;</span></p></td><td></td></tr><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>main_vbox</code></em>;</span></p></td><td></td></tr><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>ok_button</code></em>;</span></p></td><td></td></tr><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>cancel_button</code></em>;</span></p></td><td>the two main buttons that signals should be connected to in order to perform an action when the user hits either OK or Cancel.</td></tr><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>help_button</code></em>;</span></p></td><td></td></tr><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>history_pulldown</code></em>;</span></p></td><td>the <a class="link" href="GtkOptionMenu.html" title="GtkOptionMenu"><span class="type">GtkOptionMenu</span></a> used to create the drop-down directory history.</td></tr><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>history_menu</code></em>;</span></p></td><td></td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList">GList</a> *<em class="structfield"><code>history_list</code></em>;</span></p></td><td></td></tr><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>fileop_dialog</code></em>;</span></p></td><td>the dialog box used to display the <a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a>. It can be customized by adding/removing widgets from it using the standard <a class="link" href="GtkDialog.html" title="GtkDialog"><span class="type">GtkDialog</span></a> functions.</td></tr><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>fileop_entry</code></em>;</span></p></td><td></td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *<em class="structfield"><code>fileop_file</code></em>;</span></p></td><td></td></tr><tr><td><p><span class="term"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> <em class="structfield"><code>cmpl_state</code></em>;</span></p></td><td></td></tr><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>fileop_c_dir</code></em>;</span></p></td><td></td></tr><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>fileop_del_file</code></em>;</span></p></td><td></td></tr><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>fileop_ren_file</code></em>;</span></p></td><td>the buttons that appear at the top of the file selection dialog. These "operation buttons" can be hidden and redisplayed with <a class="link" href="GtkFileSelection.html#gtk-file-selection-hide-fileop-buttons"><code class="function">gtk_file_selection_hide_fileop_buttons()</code></a> and <a class="link" href="GtkFileSelection.html#gtk-file-selection-show-fileop-buttons"><code class="function">gtk_file_selection_show_fileop_buttons()</code></a> respectively.</td></tr><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>button_area</code></em>;</span></p></td><td></td></tr><tr><td><p><span class="term"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *<em class="structfield"><code>action_area</code></em>;</span></p></td><td></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4533024"></a><h3><a name="gtk-file-selection-new"></a>gtk_file_selection_new ()</h3><a class="indexterm" name="id4533040"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_file_selection_new (const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *title);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><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"><code class="function">gtk_file_chooser_dialog_new()</code></a> instead</p></div><p>Creates a new file selection dialog box. By default it will contain a <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a> of the application's current working directory, and a file listing. Operation buttons that allow the user to create a directory, delete files and rename files, are also present.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>title</code></em> :</span></p></td><td>a message that will be placed in the file requestor's titlebar.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the new file selection.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4533134"></a><h3><a name="gtk-file-selection-set-filename"></a>gtk_file_selection_set_filename ()</h3><a class="indexterm" name="id4533150"></a><pre class="programlisting">void gtk_file_selection_set_filename (<a class="link" href="GtkFileSelection.html" title="GtkFileSelection">GtkFileSelection</a> *filesel, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *filename);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_file_selection_set_filename</code> is deprecated and should not be used in newly-written code.</p></div><p>Sets a default path for the file requestor. If <em class="parameter"><code>filename</code></em> includes adirectory path, then the requestor will open with that path as itscurrent working directory.</p><p>This has the consequence that in order to open the requestor with a working directory and an empty filename, <em class="parameter"><code>filename</code></em> must have a trailingdirectory separator.</p><p>The encoding of <em class="parameter"><code>filename</code></em> is preferred GLib file name encoding, whichmay not be UTF-8. See <ahref="/usr/share/gtk-doc/html/glib/glib-Character-Set-Conversion.html#g-filename-from-utf8"><code class="function">g_filename_from_utf8()</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>filesel</code></em> :</span></p></td><td> a <a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a>.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td><td> a string to set as the default file name.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id4533286"></a><h3><a name="gtk-file-selection-get-filename"></a>gtk_file_selection_get_filename ()</h3><a class="indexterm" name="id4533302"></a><pre class="programlisting">const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a>* gtk_file_selection_get_filename (<a class="link" href="GtkFileSelection.html" title="GtkFileSelection">GtkFileSelection</a> *filesel);</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p><code class="literal">gtk_file_selection_get_filename</code> is deprecated and should not be used in newly-written code.</p></div><p>This function returns the selected filename in the GLib file nameencoding. To convert to UTF-8, call <ahref="/usr/share/gtk-doc/html/glib/glib-Character-Set-Conversion.html#g-filename-to-utf8"><code class="function">g_filename_to_utf8()</code></a>. Thereturned string points to a statically allocated buffer and shouldbe copied if you plan to keep it around.</p><p>If no file is selected then the selected directory path is returned.</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>filesel</code></em> :</span></p></td><td> a <a class="link" href="GtkFileSelection.html" title="GtkFileSelection"><span class="type">GtkFileSelection</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> currently-selected filename in the on-disk encoding.</td></tr></tbody>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -