Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use Tk; use strict; use warnings; #--- Variables--- my $program_title = "TESTING"; my $admission_1_value; my $admission_2_value; my $admission_3_valu +e; my $admission_4_value; my $admission_5_value; my $admission_6_value; my $ +admission_7_value; my $admission_8_value; my $admission_9_value; my $admission_10_value; +my $charge_1_value; my $charge_2_value; my $charge_3_value; my $charge_4_value; my $charge +_5_value; my $charge_6_value; my $charge_7_value; my $charge_8_value; my $charge_9_ +value; my $charge_10_value; #--- Define Main Window --- my $main_window = MainWindow->new(); $main_window->configure(-background=>'#FFFFFF'); $main_window->title("$program_title"); $main_window->minsize(qw(250 450)); $main_window->geometry('+325+150'); #--- Start Bottom Processing Field my $frame_process = $main_window->Frame(-background=>'#FFFFFF')->p +ack(side=>'bottom'); $frame_process->Button( -text=>'Process', -command=>\&PROCESS)->pack(side=>'top'); #--- Start Admission Fields --- my $frame_names = $main_window->Frame(-background=>'#FFFFFF')->pac +k(side=>'left'); my $admission_10 = $frame_names->Text(-width=>20,-height=>1)->p +ack(side=>'bottom'); $frame_names->Label(-text=>'Admission # 10', + -background=>'#FFFFFF')->pack(side=>'bottom'); my $admission_9 = $frame_names->Text(-width=>20,-height=>1)->pack( +side=>'bottom'); $frame_names->Label(-text=>'Admission # 9', + -background=>'#FFFFFF')->pack(side=>'bottom'); my $admission_8 = $frame_names->Text(-width=>20,-height=>1)->pack( +side=>'bottom'); $frame_names->Label(-text=>'Admission # 8', + -background=>'#FFFFFF')->pack(side=>'bottom'); my $admission_7 = $frame_names->Text(-width=>20,-height=>1)->pack( +side=>'bottom'); $frame_names->Label(-text=>'Admission # 7', + -background=>'#FFFFFF')->pack(side=>'bottom'); my $admission_6 = $frame_names->Text(-width=>20,-height=>1)->pack( +side=>'bottom'); $frame_names->Label(-text=>'Admission # 6', + -background=>'#FFFFFF')->pack(side=>'bottom'); my $admission_5 = $frame_names->Text(-width=>20,-height=>1)->pack( +side=>'bottom'); $frame_names->Label(-text=>'Admission # 5', + -background=>'#FFFFFF')->pack(side=>'bottom'); my $admission_4 = $frame_names->Text(-width=>20,-height=>1)->pack( +side=>'bottom'); $frame_names->Label(-text=>'Admission # 4', + -background=>'#FFFFFF')->pack(side=>'bottom'); my $admission_3 = $frame_names->Text(-width=>20,-height=>1)->pack( +side=>'bottom'); $frame_names->Label(-text=>'Admission # 3', + -background=>'#FFFFFF')->pack(side=>'bottom'); my $admission_2 = $frame_names->Text(-width=>20,-height=>1)->pack( +side=>'bottom'); $frame_names->Label(-text=>'Admission # 2', + -background=>'#FFFFFF')->pack(side=>'bottom'); my $admission_1 = $frame_names->Text(-width=>20,-height=>1)->pack( +side=>'bottom'); $frame_names->Label(-text=>'Admission # 1', + -background=>'#FFFFFF')->pack(side=>'bottom'); #--- BLANK COLUMN my $frame_blank5 = $main_window->Frame(-background=>'#FFFFFF')- +>pack(side=>'left'); $frame_blank5->Label(-text=>' ', -background=>'#FFFFFF')->pack(side=>'bottom'); #---Start Charge Fields my $frame_charge = $main_window->Frame(-background=>'#FFFFFF')- +>pack(side=>'left'); my $charge_10 = $frame_charge->Text(-width=>12, -height=>1)->pack( +side=>'bottom'); $frame_charge->Label(-text=>'Charge', -background=>'#FFFFFF')->pack(side=>'bottom'); my $charge_9 = $frame_charge->Text(-width=>12, -height=>1)->pack(s +ide=>'bottom'); $frame_charge->Label(-text=>'Charge', -background=>'#FFFFFF')->pack(side=>'bottom'); my $charge_8 = $frame_charge->Text(-width=>12, -height=>1)->pack(s +ide=>'bottom'); $frame_charge->Label(-text=>'Charge', -background=>'#FFFFFF')->pack(side=>'bottom'); my $charge_7 = $frame_charge->Text(-width=>12, -height=>1)->pack(s +ide=>'bottom'); $frame_charge->Label(-text=>'Charge', -background=>'#FFFFFF')->pack(side=>'bottom'); my $charge_6 = $frame_charge->Text(-width=>12, -height=>1)->pack(s +ide=>'bottom'); $frame_charge->Label(-text=>'Charge', -background=>'#FFFFFF')->pack(side=>'bottom'); my $charge_5 = $frame_charge->Text(-width=>12, -height=>1)->pack(s +ide=>'bottom'); $frame_charge->Label(-text=>'Charge', -background=>'#FFFFFF')->pack(side=>'bottom'); my $charge_4 = $frame_charge->Text(-width=>12, -height=>1)->pack(s +ide=>'bottom'); $frame_charge->Label(-text=>'Charge', -background=>'#FFFFFF')->pack(side=>'bottom'); my $charge_3 = $frame_charge->Text(-width=>12, -height=>1)->pack(s +ide=>'bottom'); $frame_charge->Label(-text=>'Charge', -background=>'#FFFFFF')->pack(side=>'bottom'); my $charge_2 = $frame_charge->Text(-width=>12, -height=>1)->pack(s +ide=>'bottom'); $frame_charge->Label(-text=>'Charge', -background=>'#FFFFFF')->pack(side=>'bottom'); my $charge_1 = $frame_charge->Text(-width=>12, -height=>1)->pack(s +ide=>'bottom'); $frame_charge->Label(-text=>'Charge', -background=>'#FFFFFF')->pack(side=>'bottom'); sub PROCESS { #--- GET all Text Field Entries --- my $admission_1_value = $admission_1->get('1.0', 'end'); my $admission_2_value = $admission_2->get('1.0', 'end'); my $admission_3_value = $admission_3->get('1.0', 'end'); my $admission_4_value = $admission_4->get('1.0', 'end'); my $admission_5_value = $admission_5->get('1.0', 'end'); my $admission_6_value = $admission_6->get('1.0', 'end'); my $admission_7_value = $admission_7->get('1.0', 'end'); my $admission_8_value = $admission_8->get('1.0', 'end'); my $admission_9_value = $admission_9->get('1.0', 'end'); my $admission_10_value = $admission_10->get('1.0', 'end'); my $charge_1_value = $charge_1->get('1.0', 'end'); my $charge_2_value = $charge_2->get('1.0', 'end'); my $charge_3_value = $charge_3->get('1.0', 'end'); my $charge_4_value = $charge_4->get('1.0', 'end'); my $charge_5_value = $charge_5->get('1.0', 'end'); my $charge_6_value = $charge_6->get('1.0', 'end'); my $charge_7_value = $charge_7->get('1.0', 'end'); my $charge_8_value = $charge_8->get('1.0', 'end'); my $charge_9_value = $charge_9->get('1.0', 'end'); my $charge_10_value = $charge_10->get('1.0', 'end'); #-- Define Column Arrays --- my @patients = ("$admission_1_value", "$admission_2_value", "$admi +ssion_3_value", "$admission_4_value", "$admission_5_value", "$admission_6_ +value", "$admission_7_value", "$admission_8_value", "$admission_9_ +value", "$admission_10"); my @charge = ("$charge_1_value", "$charge_2_value", "$charge_3_val +ue", "$charge_4_value", "$charge_5_value", "$charge_6_value", + "$charge_7_value", "$charge_8_value", "$charge_9_value", + "$charge_10_value"); my @INVOICE = ("@patients", "\n", "@charge"); #--- PRINT ALL ENTRIES print @INVOICE; }; #--- Create GUI -- MainLoop;
janitored by ybiC: Balanced <readmore> tags around long codeblock
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unexpected Error While Retreiving Text in Perl\Tk
by saskaqueer (Friar) on Jun 08, 2004 at 06:38 UTC | |
|
Re: Unexpected Error While Retreiving Text in Perl\Tk
by saskaqueer (Friar) on Jun 08, 2004 at 06:15 UTC | |
|
Re: Unexpected Error While Retreiving Text in Perl\Tk
by mawe (Hermit) on Jun 08, 2004 at 06:18 UTC | |
|
Re: Unexpected Error While Retreiving Text in Perl\Tk
by eXile (Priest) on Jun 08, 2004 at 06:28 UTC | |
by eserte (Deacon) on Jun 08, 2004 at 08:41 UTC | |
|
Re: Unexpected Error While Retreiving Text in Perl\Tk
by antioch (Sexton) on Jun 08, 2004 at 06:59 UTC | |
|
Re: Unexpected Error While Retreiving Text in Perl\Tk
by antioch (Sexton) on Jun 08, 2004 at 06:27 UTC |