#!/usr/bin/perl use strict; use warnings; use Tcl::Tk;# Perl Tk GUI; Main Window my $int = new Tcl::Tk; my $mw = $int - > main window;# messing around with menubar# my $VERSION = 3.1;# build_menubar();# sub build_menubar { # my $MW = MainWindow - > new;## init;## MainLoop;### Create the menubar and File and Quit menubuttons.Note## that the cascade 's menu widget is automatically created. ## my $menubar = $MW - > Menu;# $MW - > configure(-menu => $menubar);# my $file = $menubar - > cascade(-label => '~File');# my $help = $menubar - > cascade(-label => '~Help', -tearoff => 0); ## Create the menuitems for each menu.First, the File menu item + .##$file - > command(-label => "Quit", -command => \ & fini);### Finally, the Help menuitems.##$help - > command(-label => 'Version');# $help - > separator;# $help - > command(-label => 'About');## my $ver_dialog = $MW - > Dialog(-title => 'frog Version', #-text => "frog\n\nVersion $VERSIO + N ", # - buttons => ['OK'], #-bitmap => 'info');# my $about_dialog = $MW - > Dialog(-title => 'About frog', #-text => 'About frog', #-buttons => ['OK']);# my $menu = $help - > cget('-menu');# $menu - > entryconfigure('Version', -command => [$ver_dialog => ' + Show ']); # $menu - > entryconfigure('About', -command => [$about_dialog => ' + Show ']); ## $menubar;# return the menubar## }# end build_menubar my $frame_border_top = $mw - > Frame(-relief => "flat"); my $welcome_label = $frame_border_top - > Label(-text => $frametext); my $frame_border_bottom = $mw - > Frame(-relief => "flat"); my $welcome_label_bottom = $frame_border_bottom - > Label(-text => "$progressupdate\n") - > pack(+ -side => 'right', -anchor => 'n');# printf("%-2s", "\n"); # add extra buttons if version# is > 1 # create input boxes my $e = $mw - > Entry(-textvariable => \my $citytyped) - > tooltip("enter sea + rch term1 "); my $ea = $mw - > Entry(-textvariable => \my $citytyped) - > tooltip("enter se + arch term1 "); my $e0 = $mw - > Entry(-textvariable => \my $keywordtyped) - > tooltip("enter + search term2 ")->pack(-side=>'left', -anchor=>'n'); my $e0a = $mw - > Entry(-textvariable => \my $keywordtyped) - > tooltip("ente + r search term2 ")->pack(-side=>'left', -anchor=>'n'); my $e1 = $mw - > Entry(-textvariable => \my $parsetyped) - > tooltip("enter p + arse word1 ")->pack(-side=>'left', -anchor=>'n'); my $e1a = $mw - > Entry(-textvariable => \my $parsetyped) - > tooltip("enter + parse word2 ")->pack(-side=>'left', -anchor=>'n'); my $inputcitytext = $mw - > Label(-text => "Type in search term(s) 1:" + ); my $inputkwtext = $mw - > Label(-text => "Type in search term(s) 2:"); my $inputparsetext = $mw - > Label(-text => "Type in parse words"); # my $tool_bar = $mw - > ToolBar(-text => "File"); # Geometry Management $frame_border_top - > grid(-row => 1, -column => 6, -columnspan => 1); $welcome_label - > grid(-row => 1, -column => 1, -columnspan => 2); $e - > grid(-row => 2, -column => 6); $ea - > grid(-row => 2, -column => 7); $e0 - > grid(-row => 3, -column => 6); $e0a - > grid(-row => 3, -column => 7); $e1 - > grid(-row => 4, -column => 6); $e1a - > grid(-row => 4, -column => 7); $inputcitytext - > grid(-row => 2, -column => 4); $inputkwtext - > grid(-row => 3, -column => 4); $inputparsetext - > grid(-row => 4, -column => 4); # messing with checkbuttons, comboboc, listbox # my $CB - > set(-textvariable => \my $combobox, -value => "Bing");# $CB - > get path(-textvariable => \$combobox);# $CB - > configure(-values => "USA Canada Australia")# print "combobox= $combobox \n";# $CB - > bind("<>", { scriptCombo() });# my $CB = $mw - > radiobutton(-text => "Use Metric", -command => { metric + Changed() }, #-variable => \my $measuresystem, -onvalue => "metric", -offvalue => +"imperial"); my $CB = $mw - > ComboBox(-textvariable => \my $combobox, -values => "Filter1 + Filter2 Filter3 All ")->pack(-side=>'left', -anchor=>'n'); $CB - > bind("<>", { scriptCombo() }); $CB - > grid(-row => 8, -column => 1, -columnspan => 1);# $CB - > cget(-values); $CB - > cget(-command); $CB - > configure; my $lbox = $mw - > ListBox(-height => 5); $lbox - > bind("<>", sub { scriptCombo() }); $lbox - > bind("", sub { scriptCombo() }); $mw - > bind("", sub { scriptCombo() }); $lbox - > grid(-row => 8, -column => 2, -columnspan => 1); # my $rbutton = $mw - > CheckButton(-height => 5);# $rbutton - > bind("<>", sub { scriptCombo() });# $rbutton - > grid(-row => 8, -column => 3, -columnspan => 1); sub scriptCombo { print "hello"; print "combobox= $combobox \n"; } # print "combobox= $combobox \n"; # $CB - > bind("<>", { scriptCombo() });# my $CB = $mw - > radiobutton(-text => "Use Metric", -command => { metric + Changed() }, #-variable => \my $measuresystem, -onvalue => "metric", -offva + lue => "imperial"); my $move_button3 = $mw - > Button(-text => "Run", -command => \ & CallScript); $move_button3 - > grid(-row => 5, -column => $runcolumn, -columnspan => +1); # if version is not > 1 skip button geometry # messing with checkbutton if ($version == 2) { show_buttons() }; sub show_buttons { print "in if loop"; my $select_input_file_label = $mw - > Label(-text => "Select searcht + erm1 file: " ); my $select_input_file_button = $mw - > Button(-text => "Browse", -command => \ & open_file); my $move_button = $mw - > Button(-text => "Move File", -command => \ & push_button); my $select_input_file_label2 = $mw - > Label(-text => "Select search + term2 file: " ); my $select_input_file_button2 = $mw - > Button(-text => "Browse", -command => \ & open_file); my $move_button0 = $mw - > Button(-text => "Move File", -command => \ & push_button) - > pack(+ -side => 'left', -anchor => 'n'); my $move_button1 = $mw - > Button(-text => "Move File", -command => \ & push_button); my $move_button2 = $mw - > Button(-text => "Move File", -command => \ & push_button); my $select_input_file_label3 = $mw - > Label(-text => "Select parse + file: " ); my $select_input_file_button3 = $mw - > Button(-text => "Browse", -command => \ & open_file); $select_input_file_label - > grid(-row => 2, -column => 1); $select_input_file_button - > grid(-row => 2, -column => 2); $select_input_file_label2 - > grid(-row => 3, -column => 1); $select_input_file_button2 - > grid(-row => 3, -column => 2); $select_input_file_label3 - > grid(-row => 4, -column => 1); $select_input_file_button3 - > grid(-row => 4, -column => 2); $move_button0 - > grid(-row => 2, -column => 3, -columnspan => 1); $move_button1 - > grid(-row => 3, -column => 3, -columnspan => 1); $move_button2 - > grid(-row => 4, -column => 3, -columnspan => 1);# print "runcolumn = $runcolumn\n";# $move_button3 - > grid(-row => 5, -column => $runcolumn, -columnspan => +1); } $frame_border_bottom - > grid(-row => 6, -column => 3, -columnspan => 6 + ); $welcome_label_bottom - > grid(-row => 6, -column => 3, -columnspan => 6 + ); # adding progress labels $frame_border_bottom = $mw - > Frame(-relief => "flat"); $welcome_label_bottom = $frame_border_bottom - > Label(-text => $searchingtext); $frame_border_bottom - > grid(-row => 7, -column => 3, -columnspan = + > 6); $welcome_label_bottom - > grid(-row => 7, -column => 3, -columnspan += > 6); $frame_border_bottom = $mw - > Frame(-relief => "flat"); $welcome_label_bottom = $frame_border_bottom - > Label(-text => $extractinglinkstext); $frame_border_bottom - > grid(-row => 8, -column => 3, -columnspan = + > 6); $welcome_label_bottom - > grid(-row => 8, -column => 3, -columnspan += > 6); $frame_border_bottom = $mw - > Frame(-relief => "flat"); $welcome_label_bottom = $frame_border_bottom - > Label(-text => $searchingwithaddlinkste + xt); $frame_border_bottom - > grid(-row => 9, -column => 3, -columnsp + an => 6); $welcome_label_bottom - > grid(-row => 9, -column => 3, -columns + pan => 6); $frame_border_bottom = $mw - > Frame(-relief => "flat"); $welcome_label_bottom = $frame_border_bottom - > Label(-text => $cleaninguptext); $frame_border_bottom - > grid(-row => 10, -column => 3, -columns + pan => 6); $welcome_label_bottom - > grid(-row => 10, -column => 3, -column + span => 6); $frame_border_bottom = $mw - > Frame(-relief => "flat"); $welcome_label_bottom = $frame_border_bottom - > Label(-text => $reformhtmltext); $frame_border_bottom - > grid(-row => 11, -column => 3, -col + umnspan => 6); $welcome_label_bottom - > grid(-row => 11, -column => 3, -col + umnspan => 6); $frame_border_bottom = $mw - > Frame(-relief => "flat"); $welcome_label_bottom = $frame_border_bottom - > Label(-text => $excelfiletext) + ; $frame_border_bottom - > grid(-row => 12, -column => 3, + -columnspan => 6); $welcome_label_bottom - > grid(-row => 12, -column => 3, + -columnspan => 6);