MAIN: { debug("+MAIN"); # Attempt to load the master.pcg configuration file readConfig("master.pcg"); $mainwindow = MainWindow->new(); my $menubar = $mainwindow->Frame()->grid(-row => 0, -col => 0, -columnspan => 3, -sticky => 'nw'); my $filemenu = $menubar->Menubutton(-text => 'File'); $filemenu->command( -label => 'Open Config', -command => \&loadConfig ); $filemenu->command( -label => 'Save Config', -command => \&saveConfig ); $filemenu->separator(); $filemenu->command(-label => 'Configuration...', -command => \&doConfig ); $filemenu->separator(); $filemenu->command(-label => 'Exit', -command => sub {exit;} ); $filemenu->pack(-side => 'left'); my $left = $mainwindow->Frame->grid(-row => 1, -col => 0, -sticky => 'nw'); my $right = $mainwindow->Frame->grid(-row => 1, -col => 1, -sticky => 'nw'); my $bottom = $mainwindow->Frame->grid(-row => 2, -col => 0, -columnspan => 3, -sticky => 'nw'); ### Left panel, input functionality $left->Optionmenu( -options => \@trxtype, -variable => \$trans->{TRXTYPE}, )->pack(-side => "top", -anchor => "nw"); $left->Optionmenu( -options => \@cards, -variable => \$trans->{_CARDTYPE}, )->pack(-side => "top", -anchor => "nw"); $left->LabEntry(-label => "Name", -labelPack => [-side => "right", -anchor => "w"], -width => 20, -textvariable => \$trans->{_NAME})->pack(-side => "top", -anchor => "nw"); $left->LabEntry(-label => "Card Number", -labelPack => [-side => "right", -anchor => "w"], -width => 20, -textvariable => \$trans->{ACCT})->pack(-side => "top", -anchor => "nw"); $left->LabEntry(-label => "Exp Date (1201)", -labelPack => [-side => "right", -anchor => "w"], -width => 20, -textvariable => \$trans->{EXPDATE})->pack(-side => "top", -anchor => "nw"); $left->LabEntry(-label => "Invoice Number", -labelPack => [-side => "right", -anchor => "w"], -width => 20, -textvariable => \$trans->{INVNUM})->pack(-side => "top", -anchor => "nw"); $left->LabEntry(-label => "Amount", -labelPack => [-side => "right", -anchor => "w"], -width => 20, -textvariable => \$trans->{AMT})->pack(-side => "top", -anchor => "nw"); $left->LabEntry(-label => "Original ID", -labelPack => [-side => "right", -anchor => "w"], -width => 20, -textvariable => \$trans->{ORIGID})->pack(-side => "top", -anchor => "nw"); $left->LabEntry(-label => "Street (for AVS)", -labelPack => [-side => "right", -anchor => "w"], -width => 20, -textvariable => \$trans->{STREET})->pack(-side => "top", -anchor => "nw"); $left->LabEntry(-label => "Zip (for AVS)", -labelPack => [-side => "right", -anchor => "w"], -width => 20, -textvariable => \$trans->{ZIP})->pack(-side => "top", -anchor => "nw"); $left->LabEntry(-label => "Comment 1", -labelPack => [-side => "right", -anchor => "w"], -width => 20, -textvariable => \$trans->{COMMENT1})->pack(-side => "top", -anchor => "nw"); $left->LabEntry(-label => "Comment 2", -labelPack => [-side => "right", -anchor => "w"], -width => 20, -textvariable => \$trans->{COMMENT2})->pack(-side => "top", -anchor => "nw"); # Now we will create the output section $right->Label(-text => 'PNRef')-> grid(-row => 0, -column => 0,-sticky => 'nw'); $right->Label(-textvariable => \$results->{PNREF})-> grid(-row => 0, -column => 1,-sticky => 'nw'); $right->Label(-text => 'Result')-> grid(-row => 1, -column => 0,-sticky => 'nw'); $right->Label(-textvariable => \$results->{RESULT})-> grid(-row => 0, -column => 1,-sticky => 'nw'); $right->Label(-text => 'Respcode')-> grid(qw/-row 2 -column 0 -sticky nw/); $right->Label(-textvariable => \$results->{RESPCODE})-> grid(qw/-row 2 -column 1 -sticky nw/); $right->Label(-text => 'Resmsg')-> grid(qw/-row 3 -column 0 -sticky nw/); $right->Label(-textvariable => \$results->{RESPMSG})-> grid(qw/-row 2 -column 1 -sticky nw/); $right->Label(-text => 'Authcode')-> grid(qw/-row 4 -column 0 -sticky nw/); $right->Label(-textvariable => \$results->{AUTHCODE})-> grid(qw/-row 3 -column 1 -sticky nw/); $right->Label(-text => 'Errcode')-> grid(qw/-row 5 -column 0 -sticky nw/); $right->Label(-textvariable => \$results->{ERRCODE})-> grid(qw/-row 4 -column 1 -sticky nw/); $right->Label(-text => 'Errmsg')-> grid(qw/-row 6 -column 0 -sticky nw/); $right->Label(-textvariable => \$results->{ERRMSG})-> grid(qw/-row 5 -column 1 -sticky nw/); $right->Label(-text => 'AVSZip')-> grid(qw/-row 7 -column 0 -sticky nw/); $right->Label(-textvariable => \$results->{AVSZIP})-> grid(qw/-row 6 -column 1 -sticky nw/); $right->Label(-text => 'AVSAddress')-> grid(qw/-row 8 -column 0 -sticky nw/); $right->Label(-textvariable => \$results->{AVSADDR})-> grid(qw/-row 7 -column 1 -sticky nw/); ### Bottom panel, both input & output $bottom->LabEntry(-label => "(Sent)", -labelPack => [-side => "right", -anchor => "w"], -width => 96, -textvariable => \$trans->{_PARAM})-> grid(qw/-row 0 -column 0 -sticky nw/); $bottom->LabEntry(-label => "(Recvd)", -labelPack => [-side => "right", -anchor => "w"], -width => 96, -textvariable => \$results->{RESP})-> grid(qw/-row 1 -column 0 -sticky nw/); $bottom->Button(-text => 'Process Transaction', -command => \&processTransaction )-> grid(qw/-row 2 -column 0 -sticky nesw/); MainLoop(); # Start the event processing # Will never get here debug ("-MAIN"); }