NAME

Tk::Wizard::FileSystem - Tk::Wizard pages to allow end-user filesystem access

SYNOPSIS

Currently automatically loaded by Tk::Wizard, though this behaviour is deprecated and is expected to change in 2008.

DESCRIPTION

Adds a number of methods to Tk::Wizard, to allow the end-user to access the filesystem.

METHODS

addDirSelectPage

$wizard->addDirSelectPage ( -variable => \$chosen_dir )

Adds a page (Tk::Frame) that contains a scrollable tree list of all directories including, on Win32, logical drives.

Supply in -variable a reference to a variable to set the initial directory, and to have set with the chosen path.

Supply -nowarnings with a value of 1 to list only drives which are accessible, thus avoiding Tk::DirTree warnings on Win32 where removable drives have no media.

Supply in -nowarnings a value other than 1 to avoid listing drives which are both inaccessible and - on Win32 - are either fixed drives, network drives, or RAM drives (that is types 3, 4, and 6, according to "GetDriveType" in Win32API::File).

You may also specify the -title, -subtitle and -text parameters, as in "blank_frame".

An optional -background argument is used as the background of the Entry and DirTree widgets (default is white).

Also see "callback_dirSelect".

callback_dirSelect

A callback to check that the directory, passed as a reference in the sole argument, exists, or can and should be created.

Will not allow the Wizard to continue unless a directory has been chosen. If the chosen directory does not exist, a messageBox will ask if it should be created. If the user affirms, it is created; otherwise the user is again asked to choose a directory.

Returns a Boolean value.

addFileSelectPage

$wizard->addFileSelectPage(
                           -directory => 'C:/Windows/System32',
                           -variable => \$chosen_file,
                          );

Adds a page (Tk::Frame) that contains a "Browse" button which pops up a file-select dialog box. The selected file will be displayed in a read-only Entry widget.

Supply in -directory the full path of an existing folder where the user's search shall begin.

Supply in -variable a reference to a variable to have set with the chosen file name.

You may also specify the -title, -subtitle and -text parameters, as in "blank_frame".

An optional -background argument is used as the background of the Entry widget (default is white).

addTaskListPage

Adds a page to the Wizard that will perform a series of tasks, keeping the user informed by ticking-off a list as each task is accomplished.

Whilst the task list is being executed, both the Back and Next buttons are disabled.

Parameters are as for "blank_frame", plus:

-tasks

The tasks to perform, supplied as a reference to an array, where each entry is a pair (i.e. a two-member list), the first of which is a text string to display, the second a reference to code to execute.

-delay

The length of the delay, in milliseconds, after the page has been displayed and before execution the task list is begun. Default is 1000 milliseconds (1 second). See Tk::after.

-continue

Display the next Wizard page once the job is done: invokes the callback of the Next button at the end of the task.

-todo_photo
-doing_photo
-ok_photo
-error_photo
-na_photo

Optional: all Tk::Photo objects, displayed as appropriate. -na_photo is displayed if the task code reference returns an undef value, otherwise: -ok_photo is displayed if the task code reference returns a true value, otherwise: -error_photo is displayed. These have defaults taken from Tk::Wizard::Image.

-label_frame_title

The label above the Tk::LabFrame object which contains the task list. Default label is the boring Performing Tasks:.

-frame_args

Optional: the arguments to pass in the creation of the Frame object used to contain the list.

-frame_pack

Optional: array-refernce to pass to the pack method of the Frame containing the list.

TASK LIST EXAMPLE

$wizard->addTaskListPage(
  -title => "Toy example",
  -tasks => [
    "Wait five seconds" => sub { sleep 5; 1; },
    "Wait ten seconds!" => sub { sleep 10; 1; },
    ],
  );

AUTHOR

Lee Goddard (lgoddard@cpan.org).

COPYRIGHT

Copyright (C) Lee Goddard, 11/2002 - 01/2008 ff.

Made available under the same terms as Perl itself.