logo top
Main Page   Widgets   Namespaces   Book  

Gtk::FileSelection Class Reference

Inheritance diagram for Gtk::FileSelection:

List of all members.


Detailed Description

Prompt the user for a file or directory name.

Gtk::FileSelection 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.

Deprecated:
Use the FileChooserDialog instead.

Public Member Functions

void complete (const Glib::ustring& pattern)
 FileSelection (const Glib::ustring& title)
 FileSelection ()
const HBoxget_action_area () const
 Returns: the action area.
HBoxget_action_area ()
 Returns: the action area.
const HButtonBoxget_button_area () const
HButtonBoxget_button_area ()
const Buttonget_cancel_button () const
Buttonget_cancel_button ()
const TreeViewget_dir_list () const
TreeViewget_dir_list ()
const TreeViewget_file_list () const
TreeViewget_file_list ()
std::string get_filename () const
 This function returns the selected filename in the GLib file name encoding.
const Buttonget_help_button () const
Buttonget_help_button ()
const OptionMenuget_history_pulldown () const
OptionMenuget_history_pulldown ()
const VBoxget_main_vbox () const
VBoxget_main_vbox ()
const Buttonget_ok_button () const
Buttonget_ok_button ()
bool get_select_multiple () const
 Determines whether or not the user is allowed to select multiple files in the file list.
const Entryget_selection_entry () const
Entryget_selection_entry ()
const Labelget_selection_text () const
Labelget_selection_text ()
Glib::ArrayHandle<std::string> get_selections () const
 Retrieves the list of file selections the user has made in the dialog box.
const GtkFileSelection* gobj () const
 Provides access to the underlying C GtkObject.
GtkFileSelection* gobj ()
 Provides access to the underlying C GtkObject.
void hide_fileop_buttons ()
Glib::PropertyProxy_ReadOnly
<std::string> 
property_filename () const
 The currently selected filename.
Glib::PropertyProxy<std::string> property_filename ()
 The currently selected filename.
Glib::PropertyProxy_ReadOnly
<bool> 
property_select_multiple () const
 Whether to allow multiple files to be selected.
Glib::PropertyProxy<bool> property_select_multiple ()
 Whether to allow multiple files to be selected.
Glib::PropertyProxy_ReadOnly
<bool> 
property_show_fileops () const
 Whether buttons for creating/manipulating files should be displayed.
Glib::PropertyProxy<bool> property_show_fileops ()
 Whether buttons for creating/manipulating files should be displayed.
void set_filename (const std::string& filename)
 Sets a default path for the file requestor.
void set_select_multiple (bool select_multiple=true)
 Sets whether the user is allowed to select multiple files in the file list.
void show_fileop_buttons ()
virtual ~FileSelection ()

Related Functions

(Note that these are not member functions.)

Gtk::FileSelectionwrap (GtkFileSelection* object, bool take_copy=false)
 A Glib::wrap() method for this object.

Constructor & Destructor Documentation

virtual Gtk::FileSelection::~FileSelection (  )  [virtual]

Gtk::FileSelection::FileSelection (  ) 

Gtk::FileSelection::FileSelection ( const Glib::ustring title  )  [explicit]


Member Function Documentation

void Gtk::FileSelection::complete ( const Glib::ustring pattern  ) 

const HBox* Gtk::FileSelection::get_action_area (  )  const

Returns: the action area.

Returns:
The action area.
Since gtkmm 2.14:

Reimplemented from Gtk::Dialog.

HBox* Gtk::FileSelection::get_action_area (  ) 

Returns: the action area.

Returns:
The action area.
Since gtkmm 2.14:

Reimplemented from Gtk::Dialog.

const HButtonBox* Gtk::FileSelection::get_button_area (  )  const

HButtonBox* Gtk::FileSelection::get_button_area (  ) 

const Button* Gtk::FileSelection::get_cancel_button (  )  const

Button* Gtk::FileSelection::get_cancel_button (  ) 

const TreeView* Gtk::FileSelection::get_dir_list (  )  const

TreeView* Gtk::FileSelection::get_dir_list (  ) 

const TreeView* Gtk::FileSelection::get_file_list (  )  const

TreeView* Gtk::FileSelection::get_file_list (  ) 

std::string Gtk::FileSelection::get_filename (  )  const

This function returns the selected filename in the GLib file name encoding.

To convert to UTF-8, call Glib::filename_to_utf8(). The returned string points to a statically allocated buffer and should be copied if you plan to keep it around.

If no file is selected then the selected directory path is returned.

Returns:
Currently-selected filename in the on-disk encoding.

const Button* Gtk::FileSelection::get_help_button (  )  const

Button* Gtk::FileSelection::get_help_button (  ) 

const OptionMenu* Gtk::FileSelection::get_history_pulldown (  )  const

OptionMenu* Gtk::FileSelection::get_history_pulldown (  ) 

const VBox* Gtk::FileSelection::get_main_vbox (  )  const

VBox* Gtk::FileSelection::get_main_vbox (  ) 

const Button* Gtk::FileSelection::get_ok_button (  )  const

Button* Gtk::FileSelection::get_ok_button (  ) 

bool Gtk::FileSelection::get_select_multiple (  )  const

Determines whether or not the user is allowed to select multiple files in the file list.

See set_select_multiple().

Returns:
true if the user is allowed to select multiple files in the file list.

const Entry* Gtk::FileSelection::get_selection_entry (  )  const

Entry* Gtk::FileSelection::get_selection_entry (  ) 

const Label* Gtk::FileSelection::get_selection_text (  )  const

Label* Gtk::FileSelection::get_selection_text (  ) 

Glib::ArrayHandle<std::string> Gtk::FileSelection::get_selections (  )  const

Retrieves the list of file selections the user has made in the dialog box.

This function is intended for use when the user can select multiple files in the file list.

The filenames are in the GLib file name encoding. To convert to UTF-8, call Glib::filename_to_utf8() on each string.

Returns:
A newly-allocated 0-terminated array of strings. Use Glib::strfreev() to free it.

const GtkFileSelection* Gtk::FileSelection::gobj (  )  const [inline]

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Dialog.

GtkFileSelection* Gtk::FileSelection::gobj (  )  [inline]

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Dialog.

void Gtk::FileSelection::hide_fileop_buttons (  ) 

Glib::PropertyProxy_ReadOnly<std::string> Gtk::FileSelection::property_filename (  )  const

The currently selected filename.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<std::string> Gtk::FileSelection::property_filename (  ) 

The currently selected filename.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<bool> Gtk::FileSelection::property_select_multiple (  )  const

Whether to allow multiple files to be selected.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gtk::FileSelection::property_select_multiple (  ) 

Whether to allow multiple files to be selected.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<bool> Gtk::FileSelection::property_show_fileops (  )  const

Whether buttons for creating/manipulating files should be displayed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gtk::FileSelection::property_show_fileops (  ) 

Whether buttons for creating/manipulating files should be displayed.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gtk::FileSelection::set_filename ( const std::string &  filename  ) 

Sets a default path for the file requestor.

If filename includes a directory path, then the requestor will open with that path as its current working directory.

This has the consequence that in order to open the requestor with a working directory and an empty filename, filename must have a trailing directory separator.

The encoding of filename is preferred GLib file name encoding, which may not be UTF-8. See Glib::filename_from_utf8().

Parameters:
filename A string to set as the default file name.

void Gtk::FileSelection::set_select_multiple ( bool  select_multiple = true  ) 

Sets whether the user is allowed to select multiple files in the file list.

Use get_selections() to get the list of selected files.

Parameters:
select_multiple Whether or not the user is allowed to select multiple files in the file list.

void Gtk::FileSelection::show_fileop_buttons (  ) 


Friends And Related Function Documentation

Gtk::FileSelection* wrap ( GtkFileSelection *  object,
bool  take_copy = false 
) [related]

A Glib::wrap() method for this object.

Parameters:
object The C instance.
take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns:
A C++ instance that wraps this C instance.


The documentation for this class was generated from the following file:

Generated for gtkmm 2.4 by Doxygen 1.5.6 © 1997-2001