win-32 executable not working

Posted by pashanoid on 2011-05-29 12:42
Forums: PDK Support | OS: Windows Vista

Hello,
I was so exited to start doing some gui development for windows with perl. After days of coding I'm findin out that Tk::Gauge module (which is essential) does not work with almost any platforms except win32. However, when I give perlapp directions to the blib directory containing this module, the exe builds. And they run under wine! But, when I send them to the key person who hired me to do the coding, none of my work runs on his vista 32 platform. Am I doomed? He sais he gets a dos prompt and the programs I sent him die out. Should I go and try to run them on his machine or is there no hope? Attaching the perl script I'm trying to run on a win32 machine. (delete the show gif image lines if you wish to compile it). Any suggestions/ideas are of great help. You guys are my only hope that I will continue with this project using perl!

pashanoid | Sun, 2011-05-29 12:52

disregard the cyrillic if there is any -- not important, thank you!

#!/usr/bin/perl

use strict;
use warnings;
use Tk;
use Tk::Gauge;
use Tk::ProgressBar;

my $mw = MainWindow->new;
$mw->geometry("700x700");
$mw->configure( -background=>'white' );
$mw->title("Hello World!!!");

my($hour, $Vdc);

$Vdc = 125;
my $voltmeter = $mw->Gauge(
        -highlightbackground => 'white',
    -highlightcolor => 'white',
    -highlightthickness => 0,
        -start                                  => -178,
        -extent                                 => -92,
    -style                                      => 'arc',#'pieslice',
        -margin                                 => '35',
        -outlinewidth                   => 2,
        -from                                   => 90,
        -to                                     => 150,
    -huboutline                 => 'black',
        -hubradius                              => 7,
        -hubplace                               => 'overneedle',
        -majortickinterval    => 10,
        -minortickinterval    => '1',
        -majorticklabelscale  => 10.0 / 100.0, #12.0 / 60.0,
        -bands                                  => [
                {
                        -arccolor => 'red', -minimum => 140, -maximum => 150,
                },
                {
                        -arccolor => 'yellow', -minimum => 135,-maximum => 140,
                },
                {
                        -arccolor => 'green', -minimum  => 115, -maximum => 130,
                },
                {
                        -arccolor => 'yellow', -minimum => 100, -maximum => 105,
                },
                {
                        -arccolor   => 'red', -minimum    => 90, -maximum    => 100,
                },                                                              ],
        -bandwidth => 3,
        -needles => [
                {
                        -arrowshape => [ 12, 23, 6 ],
                        -color      => 'black',
                        -command    => undef,
                        -format     => '%d',
                        -radius     => 206,
                        -tag        => '',
                        -titlecolor => 'blue',
                        -titlefont  => 'Helvetica-42',
                        -radius     => 190,
                        -variable   => \$Vdc,
                        -showvalue      => 0,
                        -width          => 1,
                },
        ] ,
)->place(-x => 0, -y => 0);
my $Vdc_lcd;
$mw->Label(-text => 'V dc', -font => ['Helvetica','20'], -background => 'white')->place(-x => 15, -y => 20);
$mw->Label(-textvariable => \$Vdc_lcd, -font => ['Helvetica','20'], -background => 'white')->place(-x => 85, -y => 223);
#$mw -> repeat(500, sub{&movement});

my $Vac = 227;
my $voltmeter_ac = $mw->Gauge(
        -highlightbackground => 'white',
        -highlightcolor => 'white',
        -highlightthickness => 0,
    -start                  => -178,
    -extent                 => -92,
    -style                  => 'arc',#'pieslice',
    -margin                 => '35',
    -outlinewidth           => 2,
    -from                   => 190,
    -to                     => 250,
    -huboutline             => 'black',
    -hubradius              => 7,
    -hubplace               => 'overneedle',
    -majortickinterval    => 10,
    -minortickinterval    => '1',
    #-majorticklabelscale  => 10.0 / 100.0, #12.0 / 60.0,
    -bands                  => [
        {
            -arccolor => 'red', -minimum => 240, -maximum => 250,
        },
        {
            -arccolor => 'yellow', -minimum => 235,-maximum => 240,
        },
        {
            -arccolor => 'green', -minimum  => 215, -maximum => 235,
        },
        {
            -arccolor => 'yellow', -minimum => 200, -maximum => 205,
        },
        {
            -arccolor   => 'red', -minimum    => 190, -maximum    => 200,
        },                              ],
    -bandwidth => 3,
    -needles => [
        {
            -arrowshape => [ 12, 23, 6 ],
            -color      => 'black',
            -command    => undef,
            -format     => '%d',
            -radius     => 206,
            -tag        => '',
            -titlecolor => 'blue',
            -titlefont  => 'Helvetica-42',
            -radius     => 190,
            -variable   => \$Vac,
            -showvalue  => 0,
            -width      => 1,
        },
    ] ,
)->place(-x => 240, -y => 0);
my $Vac_lcd;
$mw->Label(-text => 'V ac', -font => ['Helvetica','20'], -background => 'white')->place(-x => 260, -y => 20);
$mw->Label(-textvariable => \$Vac_lcd, -font => ['Helvetica','20'], -background => 'white')->place(-x => 330, -y => 223);

$mw->Photo('gui', -file => ('/home/pasha/perl/tk/map_configs.gif'));
$mw->Label(-image => 'gui', -background => 'white')->place( -x => 10, -y => 300);

$mw->Photo('logo', -file => ('/home/pasha/perl/tk/map_energy.gif'));
$mw->Label(-image => 'logo', -background => 'white')->place( -x => 450, -y => 650);

$mw->Photo('leds', -file => ('/home/pasha/perl/tk/map_leds.gif'));
$mw->Label(-image => 'leds', -background => 'white')->place( -x => 590, -y => 50);

my $Cacc = 95;
my $Cacc_text;
use Tk::LabFrame;
my $frame_batt = $mw->LabFrame(
        -background => 'white',
        -font => ['Helvetica','9'],
        -labelvariable => \$Cacc_text,  #????????? ?????
        -height => 400,         #?????? ?????
        -width  => 30,  #?????? ?????
)->place( -x => 510, -y => 20); #????????? ?? ?????
 

my $progress_batt = $frame_batt->ProgressBar(
                -highlightbackground => 'white',
        -highlightcolor => 'white',
        -highlightthickness => 0,
                -borderwidth => 2,
            -relief => 'sunken',
                -length => 390,
                -width => 35,
            -padx => 2,
            -pady => 2,
            -variable => \$Cacc,
            -colors => [0 => 'red', 20 => 'yellow' , 80 => 'green'],
            -resolution => 1,
            -blocks => 10,
            -anchor => 's',
            -from => 0,
            -to => 100

)->place(-x => 5, -y => 0,);

$mw -> repeat(500, sub{&movement});

MainLoop;

sub movement {
        my $range = 10;
        my $random_number = int(rand($range));
        if ($random_number >= 5){
                $Vdc++;
        } else {
                $Vdc--;
        }
        $Vdc = 125 if ($Vdc >=150 || $Vdc <=1); #for gauge purposes

        $Vdc_lcd = $Vdc/10;
        $Vdc_lcd = sprintf("%2.1f", $Vdc_lcd);
        $Vdc_lcd = $Vdc_lcd.' B';

        if ($random_number >= 5){
        $Vac-=5;
    } else {
        $Vac+=5;
    }
    $Vac = 225 if ($Vac >=250 || $Vac <= 190); #for gauge purposes

    $Vac_lcd = $Vac . ' B';

        $Cacc = 95; #95%
        if ($random_number >= 5){
        $Cacc--;
    } else {
        $Vac++;
    }
        $Cacc = 95 if ($Cacc >=100 || $Cacc <= 15);
        $Cacc_text = 'C '.$Cacc.'%',

}