Beefy Boxes and Bandwidth Generously Provided by pair Networks Ovid
Keep It Simple, Stupid
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Hi everyone, I'm not a Perl programmer myself, but I use Perl/Tk scripting to run the USEPA environmental modeling tool program, PE5 (http://www.epa.gov/oppefed1/models/water/pe5.pl). I'm looking to add a scroll-bar to a particular window created by the script. The section of the script I 'think' needs to be modified is this:
# Dialog box for editing applicaton intervals sub setAppIntervals { debug("+setAppIntervals"); my $n = shift; # The number of applications # remove 1st value since it's applied before the 1st interval my $n_missing = $#AppInt - $#moreRates; @moreRates = (@moreRates, ("") x $n_missing) if($n_missing > 0); my $appDial = $mainwindow->DialogBox(-title => "Edit application int +ervals", -buttons => ["Done"]); my $title = "Enter application\nintervals (days)"; # $appDial->Label(-textvariable=> \$title)->pack(-side => "top", # -anchor => "nw", -fill => 'y'); my $lablCol = $appDial->Frame->grid(-row=>0, -column=>0, -sticky=>'n +w'); my $intvCol = $appDial->Frame->grid(-row=>0, -column=>1, -sticky=>'n +w'); my $rateCol = $appDial->Frame->grid(-row=>0, -column=>2, -sticky=>'n +w'); # label the cols, firt col has a blank label to push the col's widge +ts down $lablCol->Label(-text => "", -width=>6)->pack(-side=>"top",-anchor = +> "nw"); $intvCol->Label(-text => "interval", -width=>6)->pack(-side => "top" +, -anchor => "nw"); $rateCol->Label(-text => "rate (kg/ha)", -width=>12)-> pack(-side => "top", -anchor => "nw"); if($n > 1) { for my $i(2..$n) { $lablCol -> Label(-text => "Application $i:",-pady=>2)-> pack(-side => 'top', -anchor => 'nw'); $intvCol->Entry(-width => 6, -bg => 'white', -textvariable => \$AppInt[$i-2])->pack(-side => "top", -padx => 1, -pady=>1, -anchor => "nw"); $rateCol -> Entry(-width => 9, -bg => 'white', -textvariable => \$moreRates[$i-2])->pack(-side=>'top', -padx => 1, -pady => 1, -anchor => 'nw'); } my $result = $appDial->Show; # Execute the dialog box } for(my $i = $#AppInt ; $i>$n-2 ; $i--) { pop @AppInt; # remove extra values from @AppInt pop @moreRates; } debug("-setAppIntervals; rates now set to @moreRates"); }
The way the window currently constructs itself limits the number of application intervals I can define because the window can only display so many fields. If possible, I'd love to attach a scroll-bar to this window so I can edit up to 150 application intervals. Could anyone help me add a bit of script to accomplish this? Thank you.

In reply to Seeking to Add Scrollbar by Rook

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (6)
    As of 2014-04-19 11:03 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (480 votes), past polls