Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Seeking to Add Scrollbar

by Rook (Initiate)
on Jan 17, 2013 at 18:02 UTC ( #1013844=perlquestion: print w/replies, xml ) Need Help??
Rook has asked for the wisdom of the Perl Monks concerning the following question:

Hi everyone, I'm not a Perl programmer myself, but I use Perl/Tk scripting to run the USEPA environmental modeling tool program, PE5 ( 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.

Replies are listed 'Best First'.
Re: Seeking to Add Scrollbar
by ww (Archbishop) on Jan 17, 2013 at 19:26 UTC
    Welcome to PerlMonks and the Monastery. We hope our association will be productive for you, so please pardon the abrupt phrasing (if you see it that way) of the question that follows: isn't what you're asking "Please do me a freebie so I can continue [to pursue a degree|to earn $salary] without [hiring a programmer|learning to do it myself]? (The pipes in the bracketed phrases mean "or;" the bracketing is gross abuse of a regular expression construct..)

    The Monastery comprises learners, learner-teachers, and teachers. It's mission -- and methods -- can be discerned in The Perl Monks Guide to the Monastery. Among other tidbits, this,

    " PerlMonks is many things to many people, including:
    1. A medium for making Perl as non-intimidating to learn and as easy to use as possible
    2. A place for Perl programmers (such as you) to improve your skills and share your expertise
    3. A community which allows everyone to grow and learn from everyone else"

    There's nothing there that says this is code-a-matic.

    Then there's an important suggestion in para 3, "Checking other Resources First," in On asking for help. I think that subhead is obvious enough, when taken in the context of "asking for help." But there's more: Perl Monks Site FAQ and if you feel our solution to your problem is worth having, it's probably worthwhile for you to learn about the community's norms and recommendations.

    Please don't let this disuade you from frequenting the Monastery if my initial question includes off-the-mark speculation. There are many willing teachers here, if you show us that you've made some effort to solve your own problem.

    Update: And for the sharp-eyed with error-reporting set up high, this is an offer of at least one "++" for the Monk who finds the extra </i> about which the error-checking complains. :)
    Update2: See below! And no, I'm not fixing it as it may be a mind-twister that others find interesting.

      Its not an extra </i>, its a missing one... it looks like you started some italics near the beginning of the <ol>, and forgot to end them

        Well, not exactly, but ++ anyway, since that represented the clue-by-four I needed:

        Violating a variety of standards (about which I sometimes yawp), I opened an italic tag between the blockquote tag and the opening double_quote, but didn't bother to close it until after the closing double quote and just before the last closing list-item tag... i.e., a whole ordered list later.

        W3C would slap my hand, but I don't think I've often seen PM's implementation of an html subset complain about such.

      Thanks for the reply. I will spend some more time scouring the website to see what I can learn.
Re: Seeking to Add Scrollbar
by Anonymous Monk on Jan 18, 2013 at 01:12 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1013844]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2018-05-22 14:15 GMT
Find Nodes?
    Voting Booth?