Ahh yes, worked great. I had to tweak it a bit to get it to scroll to the line I wanted to and not past it. For some reason is you hav 200 total lines and you tell it to scroll to the 50th line it would be 200/50 which would scrill to the 51st line (I am guessing rounding off the decimal or something). So what I did was I would prompt for what line to scroll to then subtract one and run it through the division and then readd 1 back to it again after I was done. I know that sounds a little confusing so here is the code, it might make more since then I can.
sub go_to { my $sw = MainWindow->new(-title=>"Go To Line"); my $frame = $sw->Frame->pack(-side => 'top', -fill => 'x'); $frame->Label(-text => "Enter Line Number:")->pack(-side => 'left', + -anchor => 'w'); $frame->Entry(-textvariable => \$line_number)-> pack(-side => 'left', -anchor => 'w', -fill => 'x', -expand => 1 +); $frame->Button(-text => "GO", -background => 'navy blue', -foregrou +nd => 'white', -command =>\&scroll_line)-> pack(-side => 'right'); sub scroll_line { $line_number = $line_number - 1; my $calc = $line_number/$line_count; $t->yviewMoveto($calc); $line_number = $line_number + 1; } }
Thanx again for the help.

In reply to Re: Re: Re: Re: Re: Invoking scrolling externally on a Perl/Tk Scrolled widget by Elijah
in thread Invoking scrolling externally on a Perl/Tk Scrolled widget by forrest

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.