2008/05/16

The Labs.Com Issue_08_MacPerl
Last update 1999/02/20

TPJ: Issue_08_MacPerl

This is a collection of programs published by The Perl Journal. You can download all source-code also from TPJ: Programs.
  1. aete.converter
  2. appleevent.pl
  3. pbar.pl
  4. More Samples on MacPerl
Issue_08_MacPerl
1. aete.converter
  • aete.converter
  • Issue_08_MacPerl
    2. 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_MacPerl
    3. 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_MacPerl
    4. More Samples on MacPerl

    • Issue_08_MacPerl

                                                                                                                                       

    Last update 1999/02/20

    All Rights Reserved - (C) 1997 - 2008 by The Labs.Com

    Top of Page

    The Labs.Com