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;
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |