## (Apologies to John Stoffel and Stephen O. Lidie)
##
## Changes:
## Ver 1.1 Changed show to Show, unshow to unShow, and general
## cleanup for perl5.002 gamma
=head1 NAME
Tk::WaitBox - An Object Oriented Wait Dialog for Perl/Tk, of the Please Wait variety.
=head1 DESCRIPTION
A WaitBox consists of a number of subwidgets:
=over 4
=item
=head2 bitmap
A bitmap (configurable via the I<-bitmap> command, the default is an hourglass) on the left side of the WaitBox
=head2 label
A label (configurable via the I<-txt1> command), with text in the upper portion of the right hand frame
=head2 secondary label
Another label (configurable via the I<-txt2> command, the default is 'Please Wait'), with text in the lower portion of the right hand frame
=head2 userframe
A frame displayed, if required, between the label and the secondary label. For details, see the example code and the Advertised Widget section
=head2 cancel button
If a cancelroutine (configured via the I<-cancelroutine> command) is defined, a frame will be packed below the labels and bitmap, with a single button. The text of the button will be 'Cancel' (configurable via the I<-canceltext> command), and the button will call the supplied subroutine when pressed.
=back
=head1 SYNOPSIS
=over 4
=item Usage Description
=item
=head2 Basic Usage
To use, create your WaitDialog objects during initialization, or at least before a Show. When you wish to display the WaitDialog object, invoke the 'Show' method on the WaitDialog object; when you wish to cease displaying the WaitDialog object, invoke the 'unShow' method on the object.
=head2 Configuration
Configuration may be done at creation or via the configure method.
=head2 Example Code
=item
#!/usr/local/bin/perl -w
use Tk;
use Tk::WaitBox;
use strict;
my($root) = MainWindow->new;
my($utxt) = "Initializing...";
my($wd) = $root->WaitBox(
-bitmap =>'questhead', # Default would be 'hourglass'
-txt2 => 'tick-tick-tick', #default would be 'Please Wait'
-title => 'Takes forever to get service around here',
-cancelroutine => sub {
print "\nI'm canceling....\n";
$wd->unShow;
$utxt = undef;
});
$wd->configure(-txt1 => "Hurry up and Wait, my Drill Sergeant told me");
uframe is a frame created between the two messages. It may be used for anything the user has in mind... including exciting cycle wasting displays of sand dropping through an hour glass, Zippy riding either a Gnu or a bronc, et cetera.
Assuming that the WaitBox is referenced by $w, the uframe may be addressed as $w->subwidget{'uframe'}. Having gotten the address, you can do anything (I think) you would like with it
=back
=head1 Author
B<Brent B. Powers, Merrill Lynch (B2Pi)>
powers@ml.com
This code may be distributed under the same conditions as perl itself.