 2008/05/16
|
Last update 1999/02/20
TPJ: Issue_08_MacPerl
- aete.converter
- appleevent.pl
- pbar.pl
- More Samples on MacPerl
| Issue_08_MacPerl1. aete.converter
|
aete.converter
| Issue_08_MacPerl2. appleevent.pl
|
Download appleevent.pl
|
#!perl -wl015
|
|
use Mac::AppleEvents;
|
|
$params = "kocl:type(cwin), prdt:{ pnam: Counting , ppos:[\
|
|
100, 50] }";
|
|
$evt = AEBuildAppleEvent('core','crel',typeApplSignature,'PBar',0,0,$p\
|
|
arams) || die $^E;
|
|
$rep = AESend($evt, kAEWaitReply) || die $^E;
|
|
|
|
print AEPrint($evt)
|
|
print AEPrint($rep);
|
|
AEDisposeDesc($evt);
|
|
AEDisposeDesc($rep);
|
|
# NOTES:
|
|
# \015 is the Mac linebreak character, not \012!
|
|
# curly quotes (option-[ and option-shift-[) go around items of
|
|
# type TEXT. Remember, these are non-ASCII characters.
|
|
# $^E is similar to $!, but gives platform-specific error info
|
|
# AEs don't do automatic garbage collection, so
|
|
# we dispose of the event with AEDisposeDesc
|
| Issue_08_MacPerl3. pbar.pl
|
Download pbar.pl
|
#!perl -w
|
|
use strict;
|
|
use Mac::Apps::PBar;
|
|
#create window
|
|
my $bar = Mac::Apps::PBar->new('FTP Download','100, 50');
|
|
|
|
#Module sets each element of hashref in turn
|
|
$bar->data({Cap1=>'file: BigFile.tar.gz',Cap2=>'size: 1,230K'\
|
|
,MinV=>'0',MaxV=>'1230'});
|
|
#set the value of the bar incrementally for 11 iterations
|
|
for(0..10) {
|
|
$bar->data({Valu=>$_*123});
|
|
sleep(1);
|
|
}
|
|
sleep(5);
|
|
$bar->close_window;
|
| Issue_08_MacPerl4. More Samples on MacPerl
|

Last update 1999/02/20 
All Rights Reserved - (C) 1997 - 2008 by The Labs.Com |