Tk::DirSelect(3pm) User Contributed Perl Documentation Tk::DirSelect(3pm)NAME
Tk::DirSelect - Cross-platform directory selection widget.
SYNOPSIS
use Tk::DirSelect;
my $ds = $mw->DirSelect();
my $dir = $ds->Show();
DESCRIPTION
This module provides a cross-platform directory selection widget. For systems running Microsoft Windows, this includes selection of local
and mapped network drives. A context menu (right-click or <Button3>) allows the creation, renaming, and deletion of directories while
browsing.
Note: Perl/Tk 804 added the "chooseDirectory" method which uses native system dialogs where available. (i.e. Windows) If you want a native
feel for your program, you probably want to use that method instead -- possibly using this module as a fallback for systems with older
versions of Tk installed.
METHODS
"DirSelect([-title => 'title'], [options])"
Constructs a new DirSelect widget as a child of the invoking object (usually a MainWindow).
The title for the widget can be set by specifying "-title => 'Title'". Any other options provided will be passed through to the DirTree
widget that displays directories, so be sure they're appropriate (e.g. "-width")
"Show([directory], [options])"
Displays the DirSelect widget and returns the user selected directory or "undef" if the operation is canceled.
All arguments are optional. The first argument (if defined) is the initial directory to display. The default is to display the current
working directory. Any additional options are passed through to the Popup() method. This means that you can do something like
$ds->Show(undef, -popover => $mw);
to center the dialog over your application.
DEPENDENCIES
o Perl 5.004
o Tk 800
o Win32API::File (under Microsoft Windows only)
LICENSE AND COPYRIGHT
Copyright 2000-2001 Kristi Thompson <kristi@kristi.ca> Copyright 2002-2005,2010 Michael Carman <mjcarman@cpan.org>
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as
published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
perl v5.10.1 2010-02-18 Tk::DirSelect(3pm)
Check Out this Related Man Page
Popup(3pm) User Contributed Perl Documentation Popup(3pm)NAME
Tk::Wm::Popup - popup dialog windows.
SYNOPSIS
$dialog->Popup(qw/
-popover => 'cursor' | $widget | undef,
-overanchor => c | n | ne | e | se | s | sw | w | nw,
-popanchor => c | n | ne | e | se | s | sw | w | nw,
/);
DESCRIPTION
You've probably had occasion to use a Dialog (or DialogBox) widget. These widgets are derived from a Toplevel (which is a subclass of
Tk::Wm, the window manager) and spend most of their time in a withdrawn state. It's also common to use Toplevels as containers for custom
built popup windows. Menus, too, are dialogs derived from the window manager class. For this discussion, we'll use the simple term dialog
to refer any widget that pops up and awaits user interaction, whether it be a Menu, a special purpose Toplevel, or any of the dialog-type
widgets, including, but not limited to, ColorEditor, Dialog, DialogBox, ErrorDialog, FileSelect, FBox, getOpenFile and getSaveFile.
When it's time to display these dialogs, we call the Perl/Tk window manager Popup method. Popup accepts three special purpose options that
specify placement information in high-level terms rather than numerical coordinates. It is Popup's responsibility to take our human
specifications and turn them into actual screen coordinates before displaying the dialog.
We can direct the dialog to appear in two general locations, either over another window (e.g. the root window (screen) or a particular
widget), or over the cursor. This is called the popover location. Once we've made this decision we can further refine the exact placement
of the dialog relative to the popover location by specifying the intersection of two anchor points. The popanchor point is associated with
the dialog and the overanchor point is associated with the popover location (whether it be a window or the cursor). The point where the two
anchor points coincide is the popup locus. Anchor points are string values and can be c (for center), or any of the eight cardinal compass
points: n, ne, e, se, s, sw, w or nw.
For example, if -popover specifies a widget, -popanchor is sw, and -overanchor is ne, the the dialog's southwest corner pops up at the
widget's northeast corner.
OPTIONS
The options recognized by Popup are as follows:
-popover
Specifies whether the dialog "pops over" a window or the cursor. It may be the string cursor, a widget reference, or undef for the
root window.
-popanchor
Specifies the anchor point of the dialog. For instance, if e is specified, the right side of the dialog is the anchor.
-overanchor
Specifies where the dialog should anchor relative to the popover location. For instance, if e is specified the dialog appears over the
right side of the popover location and if it's ne the the dialog is positioned at the upper-right corner of the popover location.
AUTHOR
Nick Ing-Simmons, Steve Lidie
This code is distributed under the same terms as Perl.
perl v5.14.2 2010-05-29 Popup(3pm)