<html> <head><title>Gtk-- Reference: Gtk::FileSelection</title></head> <body bgcolor="#F0F0F0" text="#000000" link="#0000FF" vlink="#000077" alink="#FF0000"> <table align=center border=0 cellspacing=10> <tr> <td><a href="class_index.html">Class Index</a></td> <td><a href="cross_index.html">Cross Index</a></td> <td><a href="name_index.html">Namespace Index</a></td> </table> <h1 align=center>Class Gtk::FileSelection</h1><p> <b> Prompt the user for a file or directory name.</b><br> Contained in: <a href="Gtk.html">Gtk</a><br> Derived from: <a href="Gtk%3A%3AWindow.html">Gtk::Window</a> <br> Derived by: <i>none</i> <p> #include <gtk--/fileselection.h> <p> <hr noshade> <table border=0> <tr><td colspan=3><h3>public function member index:</h3></td> <tr valign=top><td align=right><tt><tt>explicit</tt> </tt> </td><td align=right><a href="Gtk%3A%3AFileSelection.html#1486"><tt><font color=blue><b>FileSelection</b></font></tt></a></td><td><tt>(<tt>const</tt> <a href="Gtk%3A%3Anstring.html"><tt><font color=navy><b>nstring</b></font></tt></a>& <tt><font color=blue>title</font></tt>=0)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AFileSelection.html#1489"><tt><font color=blue><b>complete</b></font></tt></a></td><td><tt>(<tt>const</tt> <tt><font color=navy>string</font></tt>& <tt><font color=blue>pattern</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><a href="Gtk%3A%3AHBox.html"><tt><font color=navy><b>HBox</b></font></tt></a>*</tt> </td><td align=right><a href="Gtk%3A%3AFileSelection.html#1492"><tt><font color=blue><b>get_action_area</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><a href="Gtk%3A%3AButton.html"><tt><font color=navy><b>Button</b></font></tt></a>*</tt> </td><td align=right><a href="Gtk%3A%3AFileSelection.html#1496"><tt><font color=blue><b>get_cancel_button</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt><font color=navy>string</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AFileSelection.html#1490"><tt><font color=blue><b>get_filename</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><a href="Gtk%3A%3AButton.html"><tt><font color=navy><b>Button</b></font></tt></a>*</tt> </td><td align=right><a href="Gtk%3A%3AFileSelection.html#1495"><tt><font color=blue><b>get_ok_button</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><a href="Gtk%3A%3AEntry.html"><tt><font color=navy><b>Entry</b></font></tt></a>*</tt> </td><td align=right><a href="Gtk%3A%3AFileSelection.html#1493"><tt><font color=blue><b>get_selection_entry</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><a href="Gtk%3A%3ALabel.html"><tt><font color=navy><b>Label</b></font></tt></a>*</tt> </td><td align=right><a href="Gtk%3A%3AFileSelection.html#1494"><tt><font color=blue><b>get_selection_text</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt><font color=navy>GtkFileSelection</font></tt>*</tt> </td><td align=right><a href="Gtk%3A%3AFileSelection.html#1482"><tt><font color=blue><b>gtkobj</b></font></tt></a></td><td><tt>()</tt>;</td> <tr valign=top><td align=right><tt><tt>const</tt> <tt><font color=navy>GtkFileSelection</font></tt>*</tt> </td><td align=right><a href="Gtk%3A%3AFileSelection.html#1483"><tt><font color=blue><b>gtkobj</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AFileSelection.html#1488"><tt><font color=blue><b>hide_fileop_buttons</b></font></tt></a></td><td><tt>()</tt>;</td> <tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=purple>bool</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AFileSelection.html#1484"><tt><font color=blue><b>isA</b></font></tt></a></td><td><tt>(<a href="Gtk%3A%3AObject.html"><tt><font color=navy><b>Object</b></font></tt></a>* <tt><font color=blue>object</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AFileSelection.html#1487"><tt><font color=blue><b>set_filename</b></font></tt></a></td><td><tt>(<tt>const</tt> <tt><font color=navy>string</font></tt>& <tt><font color=blue>filename</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3AFileSelection.html#1491"><tt><font color=blue><b>show_fileop_buttons</b></font></tt></a></td><td><tt>()</tt>;</td> <tr valign=top><td align=right><tt><tt>virtual</tt> </tt> </td><td align=right><a href="Gtk%3A%3AFileSelection.html#1485"><tt><font color=blue><b>~FileSelection</b></font></tt></a></td><td><tt>()</tt>;</td> <tr><td> </td></table> <hr noshade> <h2>Description:</h2> <tt><font color=navy><b>Gtk::FileSelection</b></font></tt> should be used to retrieve file or directory names from the user. It will create a new dialog window containing a directory list, and a file list corresponding to the current working directory. The filesystem can be navigated using the directory list or the drop-down history menu. Alternatively, the TAB key can be used to navigate using filename completion - common in text based editors such as emacs and jed. <P> The default filename can be set using <a href="Gtk%3A%3AFileSelection.html#1487"><tt><font color=blue><b>set_filename</b></font></tt></a> and the selected filename retrieved using <a href="Gtk%3A%3AFileSelection.html#1490"><tt><font color=blue><b>get_filename</b></font></tt></a>. <P> Use <a href="Gtk%3A%3AFileSelection.html#1489"><tt><font color=blue><b>complete</b></font></tt></a> to display files that match a given pattern. This can be used for example, to show only *.txt files, or only files beginning with gtk*. <P> Simple file operations; create directory, delete file, and rename file, are available from buttons at the top of the dialog. These can be hidden using <a href="Gtk%3A%3AFileSelection.html#1488"><tt><font color=blue><b>hide_fileop_buttons</b></font></tt></a> and shown again using <a href="Gtk%3A%3AFileSelection.html#1491"><tt><font color=blue><b>show_fileop_buttons</b></font></tt></a>.<br> <p> <hr noshade> <h2>Function Member Descriptions:</h2> <a name="1486"><font size=+1><b>Gtk::FileSelection::FileSelection</b></font></a> - Creates a new file selection dialog box.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt>explicit</tt> </tt> <a href="Gtk%3A%3AFileSelection.html#1486"><tt><font color=blue><b>FileSelection</b></font></tt></a><tt>(<tt>const</tt> <a href="Gtk%3A%3Anstring.html"><tt><font color=navy><b>nstring</b></font></tt></a>& <tt><font color=blue>title</font></tt>=0)</tt>;<br><blockquote> By default it will contain a <tt><font color=navy><b>Gtk::CList</b></font></tt> 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> title: A message that will be placed in the file requestor's titlebar.</blockquote> <br><br> <a name="1492"><font size=+1><b>Gtk::FileSelection::get_action_area</b></font></a> - Accessors<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><a href="Gtk%3A%3AHBox.html"><tt><font color=navy><b>HBox</b></font></tt></a>*</tt> <a href="Gtk%3A%3AFileSelection.html#1492"><tt><font color=blue><b>get_action_area</b></font></tt></a><tt>() <tt>const</tt></tt>;<br><br> <a name="1490"><font size=+1><b>Gtk::FileSelection::get_filename</b></font></a> - Retrieves the currently selected filename from the file selection dialog.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=navy>string</font></tt></tt> <a href="Gtk%3A%3AFileSelection.html#1490"><tt><font color=blue><b>get_filename</b></font></tt></a><tt>() <tt>const</tt></tt>;<br><blockquote> If no file is selected then the selected directory path is returned. <P> Returns: A string containing the selected file's full path.</blockquote> <br><br> <a name="1482"><font size=+1><b>Gtk::FileSelection::gtkobj</b></font></a> - Returns the underlaying gtk+ object.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=navy>GtkFileSelection</font></tt>*</tt> <a href="Gtk%3A%3AFileSelection.html#1482"><tt><font color=blue><b>gtkobj</b></font></tt></a><tt>()</tt>;<br><br> <a name="1488"><font size=+1><b>Gtk::FileSelection::hide_fileop_buttons</b></font></a> - Hides the file operation buttons that normally appear at the top of the dialog.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AFileSelection.html#1488"><tt><font color=blue><b>hide_fileop_buttons</b></font></tt></a><tt>()</tt>;<br><blockquote> Useful if you wish to create a custom file selector, based on <tt><font color=navy><b>Gtk::FileSelection</b></font></tt>.</blockquote> <br><br> <a name="1484"><font size=+1><b>Gtk::FileSelection::isA</b></font></a> - Returns true if object is this type.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt>static</tt> <tt><font color=purple>bool</font></tt></tt> <a href="Gtk%3A%3AFileSelection.html#1484"><tt><font color=blue><b>isA</b></font></tt></a><tt>(<a href="Gtk%3A%3AObject.html"><tt><font color=navy><b>Object</b></font></tt></a>* <tt><font color=blue>object</font></tt>)</tt>;<br><br> <a name="1487"><font size=+1><b>Gtk::FileSelection::set_filename</b></font></a> - Sets a default path for the file requestor.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AFileSelection.html#1487"><tt><font color=blue><b>set_filename</b></font></tt></a><tt>(<tt>const</tt> <tt><font color=navy>string</font></tt>& <tt><font color=blue>filename</font></tt>)</tt>;<br><blockquote> If filename includes a directory path, then the requestor will open with that path as its current working directory. <P> filename: A string to set as the default file name.</blockquote> <br><br> <a name="1491"><font size=+1><b>Gtk::FileSelection::show_fileop_buttons</b></font></a> - Shows the file operation buttons, if they have previously been hidden.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3AFileSelection.html#1491"><tt><font color=blue><b>show_fileop_buttons</b></font></tt></a><tt>()</tt>;<br><blockquote> The rest of the widgets in the dialog will be resized accordingly.</blockquote> <br><br> <hr noshade> </html>