Microcebus has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks

I made a small GUI application using Tk. My script works fine without any error or warnings. But I fail to convert this script to a standalone executable .exe file.

I tried PAR Packer and perl2exe. In both cases I get an exe file which doesn't start, although it throughs no warnings or errors. It seems there is something in the GUI that causes the trouble.

I tried converting leave over only GUI code and the result is the same. Script runs fine, exe file doesn't start.

Sorry for the amount of code but I've no idea, which part causes the trouble. I hope thy wisdom my help me.

#!/usr/bin/perl -w use Cwd; use GD; use Tk; use Tk::Pane; use Tk::StayOnTop; use Tk::BrowseEntry; use Tk::widgets qw/JPEG PNG/; use warnings; $number_of_cpus=$ENV{NUMBER_OF_PROCESSORS}; $cwd=getcwd; ### SETTINGS ### $operation_mode_selected="compare sequence 1 with sequence 2"; $window_size=10; $max_mismatch=5; $bold_for_perfect_match="semi-bold (4 pixel)"; $output_picture=1; $output_text=1; ### internal settings ### $picture_size=800; $fixed_picture_size=1; ### GUI ### $main_window=MainWindow->new; $main_window->title("Chromatic Dot Plot"); $main_window->geometry("852x852"); $main_window->maxsize(qw(852 1500)); $mw=$main_window->Scrolled('Pane',-scrollbars=>'osoe',-background=>Whi +te,-sticky=>'nw',-gridded=>'y')->pack(-fill=>'both',-expand=>1); $mw->Label(-background=>White,-height=>107,-width=>138)->pack; # labels $mw->Label(-background=>White,-font=>"Courier 14",-background=>"cornfl +ower blue",-text=>"C")->place(-width=>30,-x=>25,-y=>10); $mw->Label(-background=>White,-font=>"Courier 14",-background=>"dark s +late blue",-text=>"h")->place(-width=>30,-x=>55,-y=>10); $mw->Label(-background=>White,-font=>"Courier 14",-background=>"Medium +SeaGreen",-text=>"r")->place(-width=>30,-x=>85,-y=>10); $mw->Label(-background=>White,-font=>"Courier 14",-background=>"khaki" +,-text=>"o")->place(-width=>30,-x=>115,-y=>10); $mw->Label(-background=>White,-font=>"Courier 14",-background=>"Indian +Red",-text=>"m")->place(-width=>30,-x=>145,-y=>10); $mw->Label(-background=>White,-font=>"Courier 14",-background=>"Spring +Green4",-text=>"a")->place(-width=>30,-x=>175,-y=>10); $mw->Label(-background=>White,-font=>"Courier 14",-background=>"golden +rod2",-text=>"t")->place(-width=>30,-x=>205,-y=>10); $mw->Label(-background=>White,-font=>"Courier 14",-background=>"Medium +Orchid1",-text=>"i")->place(-width=>30,-x=>235,-y=>10); $mw->Label(-background=>White,-font=>"Courier 14",-background=>"SteelB +lue2",-text=>"c")->place(-width=>30,-x=>265,-y=>10); $mw->Label(-background=>White,-font=>"Courier 14",-background=>"seashe +ll2",-text=>"D")->place(-width=>30,-x=>333,-y=>10); $mw->Label(-background=>White,-font=>"Courier 14",-background=>"seashe +ll2",-text=>"O")->place(-width=>30,-x=>367,-y=>10); $mw->Label(-background=>White,-font=>"Courier 14",-background=>"seashe +ll2",-text=>"T")->place(-width=>30,-x=>400,-y=>10); $mw->Label(-background=>White,-font=>"Courier 14",-background=>"seashe +ll2",-text=>"P")->place(-width=>30,-x=>467,-y=>10); $mw->Label(-background=>White,-font=>"Courier 14",-background=>"seashe +ll2",-text=>"L")->place(-width=>30,-x=>500,-y=>10); $mw->Label(-background=>White,-font=>"Courier 14",-background=>"seashe +ll2",-text=>"O")->place(-width=>30,-x=>533,-y=>10); $mw->Label(-background=>White,-font=>"Courier 14",-background=>"seashe +ll2",-text=>"T")->place(-width=>30,-x=>567,-y=>10); $mw->Label(-background=>White,-font=>"Courier 8",-background=>"PeachPu +ff4",-foreground=>"AntiqueWhite2",-text=>"by David Rosenkranz\nUniver +sity Mainz, 2011")->place(-width=>183,-height=>27,-x=>630,-y=>10); $mw->Label(-background=>White,-font=>"Arial 8",-background=>"floral wh +ite",-text=>"CHROMATIC DOT PLOT draws dot plots with colors en +coding similarity.\nYou can choose to compare 2 sequences by past +ing or loading them into\nthe boxes below or to process an abitrary + number of sequence files. In the\nlatter case, each sequence will b +e plotted against itself. Beside a graphical\noutput CHROMATIC DOT +PLOT can output the plot as text matrix. The results\ncan optionally +be saved in a folder named /CDP_results[date+time]. ") +->place(-width=>414,-height=>150,-x=>400,-y=>60); $mw->Label(-background=>White,-text=>"mode of operation")->place(-x=>2 +5,-y=>60); $mw->Label(-background=>White,-text=>"window size [nt]")->place(-x=>25 +,-y=>85); $mw->Label(-background=>White,-text=>"maximum mismatch [nt]")->place(- +x=>25,-y=>110); $mw->Label(-background=>White,-text=>"print perfect match")->place(-x= +>25,-y=>135); $mw->Label(-background=>White,-text=>"save dotplot(s) as picture")->pl +ace(-x=>25,-y=>160); $mw->Label(-background=>White,-text=>"save dotplot(s) as text matrix") +->place(-x=>25,-y=>185); $mw->Label(-background=>White,-text=>"Sequence 1")->place(-x=>25,-y=>2 +30); $mw->Label(-background=>White,-text=>"Sequence 2")->place(-x=>300,-y=> +230); $mw->Label(-background=>White,-text=>"Sequence files to process")->pla +ce(-x=>615,-y=>230); $mw->Label(-background=>"grey50")->place(-width=>1000,-height=>2,-x=>2 +,-y=>500); # settings $be_operation_mode=$mw->BrowseEntry(-variable=>\$operation_mode_select +ed,-font=>"Arial 8",-width=>32,-listwidth=>214,-listheight=>2,-state= +>'readonly')->place(-x=>150,-y=>60); $be_operation_mode->insert('end',"compare sequence 1 with sequence 2", +"process sequence files from list"); $mw->Entry(-width=>5,-justify=>'right',-font=>"Arial 8",-textvariable= +>\$window_size)->place(-height=>20,-x=>150,-y=>85); $mw->Entry(-width=>5,-justify=>'right',-font=>"Arial 8",-textvariable= +>\$max_mismatch)->place(-height=>20,-x=>150,-y=>110); $be_bold_for_perfect_match=$mw->BrowseEntry(-variable=>\$bold_for_perf +ect_match,-font=>"Arial 8",-width=>32,-listwidth=>214,-listheight=>3, +-state=>'readonly')->place(-x=>150,-y=>135); $be_bold_for_perfect_match->insert('end',"regular (1 pixel)","semi-bol +d (4 pixel)","bold (9 pixel)"); $mw->Checkbutton(-background=>White,-activebackground=>White,-variable +=>\$output_picture)->place(-height=>14,-width=>26,-x=>170,-y=>165); $mw->Checkbutton(-background=>White,-activebackground=>White,-variable +=>\$output_text)->place(-height=>14,-width=>26,-x=>170,-y=>190); # sequence boxes $sequence_1_box=$mw->Scrolled("Text",-scrollbars=>'oe')->place(-x=>25, +-y=>250,-width=>200,-height=>200); $sequence_2_box=$mw->Scrolled("Text",-scrollbars=>'oe')->place(-x=>300 +,-y=>250,-width=>200,-height=>200); $mw->Button(-font=>"Arial 8",-text=>"clear seq.",-command=>sub{$sequen +ce_1_box->delete("1.0",'end');})->place(-width=>70,-x=>40,-y=>460); $mw->Button(-font=>"Arial 8",-text=>"clear seq.",-command=>sub{$sequen +ce_2_box->delete("1.0",'end');})->place(-width=>70,-x=>315,-y=>460); $mw->Button(-font=>"Arial 8",-text=>"load file",-command=>sub{sequence +_from_file();$sequence_1_box->delete("1.0",'end');$sequence_1_box->in +sert("1.0",$seq);})->place(-width=>70,-x=>130,-y=>460); $mw->Button(-font=>"Arial 8",-text=>"load file",-command=>sub{sequence +_from_file();$sequence_2_box->delete("1.0",'end');$sequence_2_box->in +sert("1.0",$seq);})->place(-width=>70,-x=>405,-y=>460); $mw->Button(-font=>"Arial 8",-text=>"use demo",-command=>sub{$sequence +_1_box->delete("1.0",'end');$sequence_2_box->delete("1.0",'end');demo +_seq();$sequence_1_box->insert("1.0",$seq1);$sequence_2_box->insert(" +1.0",$seq2);})->place(-width=>60,-x=>232,-y=>320); $mw->Button(-font=>"Arial 8",-text=>"copy seq.",-command=>sub{$sequenc +e_2_box->delete("1.0",'end');$copy_text=$sequence_1_box->get("1.0",'e +nd');$sequence_2_box->insert("1.0",$copy_text);})->place(-width=>60,- +x=>232,-y=>350); $mw->Button(-font=>"Arial 8",-text=>"rotate",-command=>sub{$seq1=$sequ +ence_1_box->get("1.0",'end');$seq2=$sequence_2_box->get("1.0",'end'); +$sequence_1_box->delete("1.0",'end');$sequence_2_box->delete("1.0",'e +nd');$seq1=~s/\n+$//;$seq2=~s/\n+$//;$sequence_1_box->insert("1.0",$s +eq2);$sequence_2_box->insert("1.0",$seq1);})->place(-width=>60,-x=>23 +2,-y=>380); # files box $files_box=$mw->Scrolled("Listbox",-scrollbars=>'se',-selectmode=>"ext +ended")->place(-x=>615,-y=>250,-width=>200,-height=>200); $mw->Button(-font=>"Arial 8",-text=>"browse & add",-command=>\&open_fi +les)->place(-width=>85,-x=>625,-y=>460); $mw->Button(-font=>"Arial 8",-text=>"remove files",-command=>\&remove_ +files)->place(-width=>85,-x=>720,-y=>460); # display plot $display_label=$mw->Label(-background=>"grey10")->place(-width=>802,-h +eight=>802,-x=>18,-y=>570); # start $start_button=$mw->Button(-font=>"Arial 8",-text=>"START",-command=>\& +check_settings)->place(-width=>50,-x=>400,-y=>520); $exit_button=$mw->Button(-font=>"Arial 8",-text=>"EXIT",-command=>sub{ +exit;})->place(-width=>50,-x=>465,-y=>520); $mw->Label(-relief=>'groove',-font=>"Arial 8",-background=>White,-text +=>"color code [ID]")->place(-width=>82,-height=>25,-x=>18,-y=>520); $mw->Label(-font=>"Arial 8",-background=>RoyalBlue3,-text=>"100%")->pl +ace(-width=>40,-height=>24,-x=>100,-y=>520); $mw->Label(-font=>"Arial 8",-background=>RoyalBlue1,-text=>">90%")->pl +ace(-width=>40,-height=>24,-x=>140,-y=>520); $mw->Label(-font=>"Arial 8",-background=>SteelBlue2,-text=>">80%")->pl +ace(-width=>40,-height=>24,-x=>180,-y=>520); $mw->Label(-font=>"Arial 8",-background=>DarkSeaGreen1 ,-text=>">70%") +->place(-width=>40,-height=>24,-x=>220,-y=>520); $mw->Label(-font=>"Arial 8",-background=>khaki2,-text=>">60%")->place( +-width=>40,-height=>24,-x=>260,-y=>520); $mw->Label(-font=>"Arial 8",-background=>goldenrod2,-text=>">50%")->pl +ace(-width=>40,-height=>24,-x=>300,-y=>520); $mw->Label(-font=>"Arial 8",-background=>brown2,-text=>">40%")->place( +-width=>40,-height=>24,-x=>340,-y=>520); $sequence_1_length=""; $sequence_2_length=""; $seq_info_label=$mw->Label(-font=>"Arial 7",-justify=>'left',-anchor=> +'w',-background=>White,-text=>"sequence 1 (horizontal) length: $seque +nce_1_length\nsequence 2 (vertical) length: $sequence_2_length")->pla +ce(-width=>200,-height=>24,-x=>530,-y=>520); MainLoop;

Replies are listed 'Best First'.
Re: GUI seems to cause trouble when being converted to exe file
by Khen1950fx (Canon) on Jul 19, 2011 at 06:56 UTC
    Starting at the beginning, here are some of the errors that I found:

    You forgot Encode::Unicode.
    I had to use Tk::JPEG and use Tk::PNG.

    You forgot to use strict. It would have alerted you the lexical problems that you had. Don't forget to declare all your variables.
    You also forgot to put single-quotes around your colors, like 'White'.

    I used the following to make the executable:
    pp --gui -o gui.exe your_fixed_script.pl
    Here is the fixed script:
    #!/usr/bin/perl use strict; use warnings; use Cwd; use GD; use Encode::Unicode; use Tk; use Tk::JPEG; use Tk::PNG; use Tk::Pane; use Tk::StayOnTop; use Tk::BrowseEntry; use Tk::widgets qw/JPEG PNG/; my $number_of_cpus = $ENV{NUMBER_OF_PROCESSORS}; my $cwd = getcwd; my $operation_mode_selected = "compare sequence 1 with sequence 2"; my $window_size = 10; my $max_mismatch = 5; my $bold_for_perfect_match = "semi-bold (4 pixel)"; my $output_picture = 1; my $output_text = 1; my $picture_size = 800; my $fixed_picture_size = 1; my $mw = MainWindow->new; $mw->title("Chromatic Dot Plot"); $mw->geometry("852x852"); $mw->maxsize(qw(852 1500)); $mw->Scrolled('Pane',-scrollbars=>'osoe',-background=>'White',-sticky= +>'nw',-gridded=>'y')->pack(-fill=>'both',-expand=>1); $mw->Label(-background=>'White',-height=>107,-width=>138)->pack; $mw->Label(-background=>'White',-font=>"Courier 14",-background=>"corn +flower blue",-text=>"C")->place(-width=>30,-x=>25,-y=>10); $mw->Label(-background=>'White',-font=>"Courier 14",-background=>"dark + slate blue",-text=>"h")->place(-width=>30,-x=>55,-y=>10); $mw->Label(-background=>'White',-font=>"Courier 14",-background=>"Medi +umSeaGreen",-text=>"r")->place(-width=>30,-x=>85,-y=>10); $mw->Label(-background=>'White',-font=>"Courier 14",-background=>"khak +i",-text=>"o")->place(-width=>30,-x=>115,-y=>10); $mw->Label(-background=>'White',-font=>"Courier 14",-background=>"Indi +anRed",-text=>"m")->place(-width=>30,-x=>145,-y=>10); $mw->Label(-background=>'White',-font=>"Courier 14",-background=>"Spri +ngGreen4",-text=>"a")->place(-width=>30,-x=>175,-y=>10); $mw->Label(-background=>'White',-font=>"Courier 14",-background=>"gold +enrod2",-text=>"t")->place(-width=>30,-x=>205,-y=>10); $mw->Label(-background=>'White',-font=>"Courier 14",-background=>"Medi +umOrchid1",-text=>"i")->place(-width=>30,-x=>235,-y=>10); $mw->Label(-background=>'White',-font=>"Courier 14",-background=>"Stee +lBlue2",-text=>"c")->place(-width=>30,-x=>265,-y=>10); $mw->Label(-background=>'White',-font=>"Courier 14",-background=>"seas +hell2",-text=>"D")->place(-width=>30,-x=>333,-y=>10); $mw->Label(-background=>'White',-font=>"Courier 14",-background=>"seas +hell2",-text=>"O")->place(-width=>30,-x=>367,-y=>10); $mw->Label(-background=>'White',-font=>"Courier 14",-background=>"seas +hell2",-text=>"T")->place(-width=>30,-x=>400,-y=>10); $mw->Label(-background=>'White',-font=>"Courier 14",-background=>"seas +hell2",-text=>"P")->place(-width=>30,-x=>467,-y=>10); $mw->Label(-background=>'White',-font=>"Courier 14",-background=>"seas +hell2",-text=>"L")->place(-width=>30,-x=>500,-y=>10); $mw->Label(-background=>'White',-font=>"Courier 14",-background=>"seas +hell2",-text=>"O")->place(-width=>30,-x=>533,-y=>10); $mw->Label(-background=>'White',-font=>"Courier 14",-background=>"seas +hell2",-text=>"T")->place(-width=>30,-x=>567,-y=>10); $mw->Label(-background=>'White',-font=>"Courier 8",-background=>"Peach +Puff4",-foreground=>"AntiqueWhite2",-text=>"by David Rosenkranz\nUniv +ersity Mainz, 2011")->place(-width=>183,-height=>27,-x=>630,-y=>10); $mw->Label(-background=>'White',-font=>"Arial 8",-background=>"floral +white",-text=>"CHROMATIC DOT PLOT draws dot plots with colors +encoding similarity.\nYou can choose to compare 2 sequences by pa +sting or loading them into\nthe boxes below or to process an abitra +ry number of sequence files. In the\nlatter case, each sequence will + be plotted against itself. Beside a graphical\noutput CHROMATIC DO +T PLOT can output the plot as text matrix. The results\ncan optionall +y be saved in a folder named /CDP_results[date+time]. +")->place(-width=>414,-height=>150,-x=>400,-y=>60); $mw->Label(-background=>'White',-text=>"mode of operation")->place(-x= +>25,-y=>60); $mw->Label(-background=>'White',-text=>"window size [nt]")->place(-x=> +25,-y=>85); $mw->Label(-background=>'White',-text=>"maximum mismatch [nt]")->place +(-x=>25,-y=>110); $mw->Label(-background=>'White',-text=>"print perfect match")->place(- +x=>25,-y=>135); $mw->Label(-background=>'White',-text=>"save dotplot(s) as picture")-> +place(-x=>25,-y=>160); $mw->Label(-background=>'White',-text=>"save dotplot(s) as text matrix +")->place(-x=>25,-y=>185); $mw->Label(-background=>'White',-text=>"Sequence 1")->place(-x=>25,-y= +>230); $mw->Label(-background=>'White',-text=>"Sequence 2")->place(-x=>300,-y +=>230); $mw->Label(-background=>'White',-text=>"Sequence files to process")->p +lace(-x=>615,-y=>230); $mw->Label(-background=>"grey50")->place(-width=>1000,-height=>2,-x=>2 +,-y=>500); my $be_operation_mode = $mw->BrowseEntry(-variable=>\$operation_mode_s +elected,-font=>"Arial 8",-width=>32,-listwidth=>214,-listheight=>2,-s +tate=>'readonly')->place(-x=>150,-y=>60); $be_operation_mode->insert('end',"compare sequence 1 with sequence 2", +"process sequence files from list"); $mw->Entry(-width=>5,-justify=>'right',-font=>"Arial 8",-textvariable= +>\$window_size)->place(-height=>20,-x=>150,-y=>85); $mw->Entry(-width=>5,-justify=>'right',-font=>"Arial 8",-textvariable= +>\$max_mismatch)->place(-height=>20,-x=>150,-y=>110); my $be_bold_for_perfect_match = $mw->BrowseEntry(-variable=>\$bold_for +_perfect_match,-font=>"Arial 8",-width=>32,-listwidth=>214,-listheigh +t=>3,-state=>'readonly')->place(-x=>150,-y=>135); $be_bold_for_perfect_match->insert('end',"regular (1 pixel)","semi-bol +d (4 pixel)","bold (9 pixel)"); $mw->Checkbutton(-background=>'White',-activebackground=>'White',-vari +able=>\$output_picture)->place(-height=>14,-width=>26,-x=>170,-y=>165 +); $mw->Checkbutton(-background=>'White',-activebackground=>'White',-vari +able=>\$output_text)->place(-height=>14,-width=>26,-x=>170,-y=>190); my $seq; my $seq1; my $seq2; my $copy_text; my $sequence_1_box = $mw->Scrolled("Text",-scrollbars=>'oe')->place(-x +=>25,-y=>250,-width=>200,-height=>200); my $sequence_2_box = $mw->Scrolled("Text",-scrollbars=>'oe')->place(-x +=>300,-y=>250,-width=>200,-height=>200); $mw->Button(-font=>"Arial 8",-text=>"clear seq.",-command=>sub{$sequen +ce_1_box->delete("1.0",'end');})->place(-width=>70,-x=>40,-y=>460); $mw->Button(-font=>"Arial 8",-text=>"clear seq.",-command=>sub{$sequen +ce_2_box->delete("1.0",'end');})->place(-width=>70,-x=>315,-y=>460); $mw->Button(-font=>"Arial 8",-text=>"load file",-command=>sub{sequence +_from_file();$sequence_1_box->delete("1.0",'end');$sequence_1_box->in +sert("1.0",$seq);})->place(-width=>70,-x=>130,-y=>460); $mw->Button(-font=>"Arial 8",-text=>"load file",-command=>sub{sequence +_from_file();$sequence_2_box->delete("1.0",'end');$sequence_2_box->in +sert("1.0",$seq);})->place(-width=>70,-x=>405,-y=>460); $mw->Button(-font=>"Arial 8",-text=>"use demo",-command=>sub{$sequence +_1_box->delete("1.0",'end');$sequence_2_box->delete("1.0",'end');demo +_seq();$sequence_1_box->insert("1.0",$seq1);$sequence_2_box->insert(" +1.0",$seq2);})->place(-width=>60,-x=>232,-y=>320); $mw->Button(-font=>"Arial 8",-text=>"copy seq.",-command=>sub{$sequenc +e_2_box->delete("1.0",'end');$copy_text=$sequence_1_box->get("1.0",'e +nd');$sequence_2_box->insert("1.0",$copy_text);})->place(-width=>60,- +x=>232,-y=>350); $mw->Button(-font=>"Arial 8",-text=>"rotate",-command=>sub{$seq1=$sequ +ence_1_box->get("1.0",'end');$seq2=$sequence_2_box->get("1.0",'end'); +$sequence_1_box->delete("1.0",'end');$sequence_2_box->delete("1.0",'e +nd');$seq1=~s/\n+$//;$seq2=~s/\n+$//;$sequence_1_box->insert("1.0",$s +eq2);$sequence_2_box->insert("1.0",$seq1);})->place(-width=>60,-x=>23 +2,-y=>380); my $files_box = $mw->Scrolled("Listbox",-scrollbars=>'se',-selectmode= +>"extended")->place(-x=>615,-y=>250,-width=>200,-height=>200); $mw->Button(-font=>"Arial 8",-text=>"browse & add",-command=>\&open_fi +les)->place(-width=>85,-x=>625,-y=>460); $mw->Button(-font=>"Arial 8",-text=>"remove files",-command=>\&remove_ +files)->place(-width=>85,-x=>720,-y=>460); my $display_label = $mw->Label(-background=>"grey10")->place(-width=>8 +02,-height=>802,-x=>18,-y=>570); my $start_button = $mw->Button(-font=>"Arial 8",-text=>"START",-comman +d=>\&check_settings)->place(-width=>50,-x=>400,-y=>520); my $exit_button = $mw->Button(-font=>"Arial 8",-text=>"EXIT",-command= +>sub{exit;})->place(-width=>50,-x=>465,-y=>520); $mw->Label(-relief=>'groove',-font=>"Arial 8",-background=>'White',-te +xt=>"color code [ID]")->place(-width=>82,-height=>25,-x=>18,-y=>520); $mw->Label(-font=>"Arial 8",-background=>'RoyalBlue3',-text=>"100%")-> +place(-width=>40,-height=>24,-x=>100,-y=>520); $mw->Label(-font=>"Arial 8",-background=>'RoyalBlue1',-text=>">90%")-> +place(-width=>40,-height=>24,-x=>140,-y=>520); $mw->Label(-font=>"Arial 8",-background=>'SteelBlue2',-text=>">80%")-> +place(-width=>40,-height=>24,-x=>180,-y=>520); $mw->Label(-font=>"Arial 8",-background=>'DarkSeaGreen1',-text=>">70%" +)->place(-width=>40,-height=>24,-x=>220,-y=>520); $mw->Label(-font=>"Arial 8",-background=>'khaki2',-text=>">60%")->plac +e(-width=>40,-height=>24,-x=>260,-y=>520); $mw->Label(-font=>"Arial 8",-background=>'goldenrod2',-text=>">50%")-> +place(-width=>40,-height=>24,-x=>300,-y=>520); $mw->Label(-font=>"Arial 8",-background=>'brown2',-text=>">40%")->plac +e(-width=>40,-height=>24,-x=>340,-y=>520); my $sequence_1_length = ""; my $sequence_2_length = ""; my $seq_info_label = $mw->Label(-font=>"Arial 7",-justify=>'left',-anc +hor=>'w',-background=>'White',-text=>"sequence 1 (horizontal) length: + $sequence_1_length\nsequence 2 (vertical) length: $sequence_2_length +")->place(-width=>200,-height=>24,-x=>530,-y=>520); MainLoop;
Re: GUI seems to cause trouble when being converted to exe file
by Anonymous Monk on Jul 19, 2011 at 07:05 UTC

    I tried PAR Packer and perl2exe. In both cases I get an exe file which doesn't start, although it throughs no warnings or errors. It seems there is something in the GUI that causes the trouble.

    You need to show what you tried :)

    Like in PAR Packer exe file doesn't run, I encounter no problems with the code you've shared.

    Actually, I did find a regression in Module::ScanDeps 1.03 if I use pp -x pm.915330.pl

    but pp -c pm.915330.pl works, a.exe gets created, it runs, tk gui pops up

      Man! That's it. Using the -c option. Exe file gets slightly bigger and works now. THANK YOU!
        Really?

        I thought I had suggested that in PAR Packer exe file doesn't run ; if that was truly all it was, you would have gotten an error message along the lines of

        Unpacking file "fc257124/auto/Cwd/Cwd.dll"... Unpacking file "ffd69863/auto/Fcntl/Fcntl.dll"... $ENV{PAR_TEMP} = ... Can't locate deprecate.pm in @INC (@INC contains: CODE(0x1566694) ... CODE(0x1247a34) CODE(0x1247d34)) at if.pm line 13. BEGIN failed--compilation aborted at Switch.pm line 7. Compilation failed in require at Tk/StayOnTop.pm line 34. BEGIN failed--compilation aborted at Tk/StayOnTop.pm line 34. Compilation failed in require at script/pm.915330.pl line 46. BEGIN failed--compilation aborted at script/pm.915330.pl line 46.

        You should try to pinpoint the disconnect (or my miscommunication) -- to speed things up in the future :)