Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Xfc::Gtk::FileChooserButton Class Reference

A GtkFileChooserButton C++ wrapper class. More...

#include <xfc/gtk/filechooserbutton.hh>

Inheritance diagram for Xfc::Gtk::FileChooserButton:

Xfc::Gtk::HBox Xfc::Gtk::FileChooser Xfc::Gtk::Box Xfc::G::TypeInterface Xfc::Gtk::Container Xfc::G::TypeInstance Xfc::Gtk::Widget Xfc::Trackable Xfc::Gtk::Object Xfc::Atk::Implementor Xfc::G::Object Xfc::G::TypeInterface Xfc::G::TypeInstance Xfc::G::TypeInstance Xfc::Trackable Xfc::Trackable Xfc::Gtk::FileChooserOpenButton List of all members.

Public Member Functions

Constructors
Accessors
Methods

Protected Member Functions

Constructors

Detailed Description

A GtkFileChooserButton C++ wrapper class.

FileChooserButton is a widget that lets the user select a file or folder. It implements the FileChooser interface. Visually, it's a file name with a button to bring up a FileChooserDialog. The user can then use that dialog to change the file associated with that button. This widget does not support setting the "select-multiple" property to true.

Example: Create a button to let the user select a file in /etc

In the simplest of cases, you can use FileChooserDialog as in the following code:

    Gtk::FileChooserButton *button = new Gtk::FileChooserButton(_("Select a file"));
    button->set_current_folder("/etc");

FileChooserButton only supports the FileChooserActions: Gtk::FILE_CHOOSER_ACTION_OPEN and Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER. FileChooserButton will ellipsize the label, and thus will thus request little horizontal space. To give the button more space, you should call set_width_chars(), Gtk::Widget::size_request(), or pack the button in such a way that other interface elements give space to the widget.


Constructor & Destructor Documentation

Xfc::Gtk::FileChooserButton::FileChooserButton GtkFileChooserButton *  button,
bool  owns_reference = false
[explicit, protected]
 

Construct a new FileChooserButton from an existing GtkFileChooserButton.

Parameters:
button A pointer to a GtkFileChooserButton.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The button can be a newly created GtkFileChooserButton or an existing GtkFileChooserButton. (see G::Object::Object).

Xfc::Gtk::FileChooserButton::FileChooserButton FileChooserAction  action,
const char *  backend = 0
 

Constructs a new FileChooserButton.

Parameters:
action The open for the widget.
backend The name of the specific filesystem backend to use, or null for the default.

Xfc::Gtk::FileChooserButton::FileChooserButton const String title,
FileChooserAction  action,
const char *  backend = 0
 

Constructs a new FileChooserButton with the given title.

Parameters:
title The title of the browse dialog.
action The open for the widget.
backend The name of the specific filesystem backend to use, or null for the default.

Xfc::Gtk::FileChooserButton::FileChooserButton FileChooserDialog dialog  ) 
 

Constructs a FileChooserButton widget which uses dialog as it's file-picking window.

Parameters:
dialog A FileChooserDialog.


Member Function Documentation

String Xfc::Gtk::FileChooserButton::get_title  )  const
 

Retrieves the title of the browse dialog used by button.

Returns:
The browse dialog's title.

int Xfc::Gtk::FileChooserButton::get_width_chars  )  const
 

Retrieves the width in characters of the button widget's entry and/or label.

Returns:
An integer width (in characters) that the button will use to size itself.

void Xfc::Gtk::FileChooserButton::set_title const String title  ) 
 

Modifies the title of the browse dialog used by the button.

Parameters:
title The new title for the browse dialog.

void Xfc::Gtk::FileChooserButton::set_width_chars int  n_chars  ) 
 

Sets the width (in characters) that button will use to n_chars.

Parameters:
n_chars The new width, in chracters.


The documentation for this class was generated from the following file: Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC 4.3