Gtk2::Ex::Dialogs::ChooseDirectory - Provides a file selection dialog.


Gtk2-Ex-Dialogs documentation  | view source Contained in the Gtk2-Ex-Dialogs distribution.

Index


NAME

Top

Gtk2::Ex::Dialogs::ChooseDirectory - Provides a file selection dialog.

SYNOPSIS

Top

 use Gtk2::Ex::Dialogs::ChooseDirectory ( destroy_with_parent => TRUE,
                                          modal => TRUE );

 # do some stuff like creating your app's main $window then,
 # to ensure that all messages use the right parent, set it:
 $Gtk2::Ex::Dialogs::ChooseDirectory::parent_window = $window;

 # now popup a new dialog for selecting an existing directory
 my $dir = select Gtk2::Ex::Dialogs::ChooseDirectory ( "/path/to/somewhere" );

 # ok, now we need to create a new directory (doesn't actually make
 # the directory), returns a dir that does not exist.
 my $dir = create Gtk2::Ex::Dialogs::ChooseDirectory ( "/path/to/somewhere" );

DESCRIPTION

Top

This module provides a simple file chooser api that wraps Gtk2::FileChooser objectively. The objective is a simple ways to prompt a user to open or save a file.

OPTIONS

Top

All public methods (and the entire class) support the following options:

title => STRING

The text string to use as the title of the dialog window. Defaults to either "Select" or "Create" based on the action context.

path => STRING

The path to a file or directory to initialize the dialog with. Defaults to the current working directory.

parent_window => Gtk2::Window

Reference to the main application window.

destroy_with_parent => BOOL

When the parent_window is destroyed, what do we do? Defaults to FALSE.

modal => BOOL

Does this dialog make the parent_window freeze while the dialog exists. Defaults to FALSE.

must_exist => BOOL

The end-user must supply a path to an existing file or directory. Should the end-user provide a non-existant path, the dialog will be respawned until an existing file is chosen. Defaults to FALSE.

PUBLIC METHODS

Top

OBJECT = new ( OPTIONS | PATH )

Create a Gtk2::FileChooserDialog with the options given and show it to the end-user. Once the user has selected a directory return only the path to the directoy and clean up. In the special case of being passed only one argument, all options are set to defaults and the one argument is used as the path argument.

RESPONSE = ask_to_select ( OPTIONS | PATH )

Supports all the same arguments as new(). This will create a new Gtk2::Ex::Dialogs::ChooseDirectory, with some specific defaults, and return the user's response. In the event of being given only one argument, it will be used as the path option.

RESPONSE = ask_to_create ( OPTIONS | PATH )

Supports all the same arguments as new(). This will create a new Gtk2::Ex::Dialogs::ChooseDirectory, with some specific defaults, and return the user's response. In the event of being given only one argument, it will be used as the path option.

SEE ALSO

Top

 Gtk2::FileChooser
 Gtk2::FileChooserDialog
 Gtk2::Ex::Dialogs
 Gtk2::Ex::Dialogs::ChooseDirectory
 Gtk2::Ex::Dialogs::ChooseFile
 Gtk2::Ex::Dialogs::ChoosePreviewFile
 Gtk2::Ex::Dialogs::ErrorMsg
 Gtk2::Ex::Dialogs::Message
 Gtk2::Ex::Dialogs::Question

BUGS

Top

Please report any bugs to the mailing list.

MAILING LIST

Top

 http://opendoorsoftware.com/lists/gtk2-ex-list
 gtk2-ex-list@opendoorsoftware.com

AUTHORS

Top

 Kevin C. Krinke, <kckrinke@opendoorsoftware.com>
 James Greenhalgh, <jgreenhalgh@opendoorsoftware.com>

COPYRIGHT AND LICENSE

Top


Gtk2-Ex-Dialogs documentation  | view source Contained in the Gtk2-Ex-Dialogs distribution.