#!/usr/local/bin/perl use warnings; use strict; use Tk; # Predeclaring the subroutines and variables sub initialize_step_selection(); sub select_soln_step(); sub deselect_soln_step(); sub modify_remove_step_dialog(); # Building the GUI skeleton, i.e. predeclaring some widgets my $MW = MainWindow->new; my $StepFrame; my $AvailListbox; my $SelectListbox; # Run the subroutines initialize_step_selection(); MainLoop(); # Creates the solutions frame, and its contents sub initialize_step_selection() { # Frame for selecting solutions $StepFrame = $MW->Frame(); $StepFrame->pack(-fill => 'both'); # Scrollbars for available solutions my $AvailScroll = $StepFrame->Scrollbar(-orient => 'vertical'); # Listbox of available solutions $AvailListbox = $StepFrame->Listbox(-yscrollcommand => ['set' => $AvailScroll]); $AvailListbox->pack(-fill => 'y', -side => 'left'); $AvailScroll->configure(-command => ['yview' => $AvailListbox]); $AvailScroll->pack(-fill => 'y',-side => 'left'); $AvailListbox->insert('end', "Just", "for", "testing", "purposes"); # Scrollbar for selected solutions my $SelectScroll = $StepFrame->Scrollbar(-orient => 'vertical'); # Listbox of selected solutions $SelectListbox = $StepFrame->Listbox(-yscrollcommand => ['set' => $SelectScroll]); $SelectListbox->pack(-fill => 'y', -side => 'left'); $SelectScroll->configure(-command => ['yview' => $SelectListbox]); $SelectScroll->pack(-fill => 'y',-side => 'left'); # Select/Deselect solutions buttons my $SelectStep = $StepFrame->Button(-text => ">",-command => sub{select_soln_step();}); $SelectStep->pack(); my $DeselectStep = $StepFrame->Button(-text => "<",-command => sub{deselect_soln_step();}); $DeselectStep->pack(); my $ModRmvStep = $StepFrame->Button( -text => "Modify/Remove a Step", -command => sub{modify_remove_step_dialog();} ); $ModRmvStep->pack( -padx => 2, -pady => 3); } # Closing initialize_step_selection()