I would like to create a widget which is using the Text option and the pack function in combination with the Scrollbar function. I have not been able to let the horizontal scrollbar work. It will always wrap off the text and put it on another line instead of enable the scrollbar. See example

#!/perl/bin/perl use Tk; # sel_report(); # ###################### Main Graphical GUI activation sub sel_report{ my $wjob = MainWindow->new; $wjob->title("GRAPHICAL COMPARE"); $testo=$wjob->Text( -borderwidth =>2, -relief => 'solid', -height +=> 40, -width => 120)->pack(); $ugo = $testo->Scrolled("Text")->pack(); open (FILE, "c:/tmp/compare_results.txt") || die "cazzo fai"; while(<FILE>){ $ugo->insert('end', "Page 1 Compare results ( UNIT ARE IN MM ) X Position Y Position JOB Name Step1 Step2 + Ref.Layer ====================================================================== +================================== -57.4763925 33.9636075 demosmall novpl vpl + results_layer_top -52.3963925 33.9636075 demosmall novpl vpl + results_layer_top -6.6763925 44.1236075 demosmall novpl vpl + results_layer_top 18.22361 8.06361 demosmall novpl vpl + results_signal_2 18.22361 13.14361 demosmall novpl vpl + results_signal_2 23.30361 13.14361 demosmall novpl vpl + results_signal_2 53.78361 23.30361 demosmall novpl vpl + results_signal_2 53.78361 28.38361 demosmall novpl vpl + results_signal_2" ); } close (FILE); MainLoop; }

In reply to Using scrollbar in combination with Text and pack function by juo

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.