Tk::Copy::Mac - simulate a Macintosh Classic copy dialog.
use Tk::Copy::Mac; $cd = $parent->Copy(-option => value);
This widget simulates a Macintosh Classic copy dialog using Tk::ProgressBar::Mac and CollapsableFrame widgets.
The following option/value pairs are supported:
The copy buffer size in bytes (default is 2,097,152 bytes). The value of this option can only be set during widget creation.
Copies 'from' to 'to'.
Component subwidgets can be accessed via the Subwidget method. Valid subwidget names are listed below.
ProgressBar widget reference.
CollapsableFrame widget reference.
#!/usr/local/bin/perl -w use Tk; use Tk::Copy::Mac; use strict; die "Usage: copy.pl from to" unless $#ARGV == 1; my $mw = MainWindow->new; my $mc = $mw->Copy(-bufsize => 4 * 1_048_576); my $b = $mw->Button( -text => "Push me to copy all files in '$ARGV[0]' to '$ARGV[1]'.", -command => sub {$mc->copy($ARGV[0], $ARGV[1])}, )->pack; $mw->Button(-text => 'Quit', -command => \&exit)->pack; $mc->Subwidget('collapsableframe')->open; MainLoop;
There are two phases to a Copy operation. First, we do a pre-scan to compute a file count and total byte count using File::Find, followed by the actual copy using File::NCopy. The pre-scan phase is blocking - we haven't made any changes to that core module to keep Tk events flowing.
We don't verify that there is sufficient room in the destination for the copy to succeed.
sol0@Lehigh.EDU
Copyright (C) 2000 - 2002, Stephen O. Lidie
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Apple, CollapsableFrame, Copy, ProgressBar
To install Tk::Copy::Mac, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tk::Copy::Mac
CPAN shell
perl -MCPAN -e shell install Tk::Copy::Mac
For more information on module installation, please visit the detailed CPAN module installation guide.