in reply to Re: Adding scroll bar in Tk label widget
in thread Adding scroll bar in Tk label widget

Unfortunately that doesn't work as I want to have the multiple line option for when the user is doing an

m/(something)(something)/

and it prints out the matches for $1, $2, etc...

My thought was to just write a function to pop in a \n when the string length returned is over 80 characters. To me this seems like a quick but bad kludge to the problem.

Is there something in Tk that would allow multiple lines AND a scroll bar?

Some people fall from grace. I prefer a running start...

Replies are listed 'Best First'.
Re: Re: Re: Adding scroll bar in Tk label widget
by rbc (Curate) on Jun 03, 2002 at 15:29 UTC
    Ah I see ... try something like this then ...
    my $t = $top->Scrolled('Text',"-relief" => "raised", "-bd" => "2", "-setgrid" => "true")->pack();
    This is taken from text_demo which is a script that
    should of been installed when you installed Tk. Tk has lots
    cool demos that pretty much answer most questions.
      That may work, but what is bothering me is the fact that I'm updating the user's input through a reference. That was the problem I had when I played with the suggestions given - it wasn't updating the results of the regex.

      At this point I'm working out how to just wrap the text every 80 characters. That seems to be the easiest option at this point. : (

      Thanks for that though. I'm going to see if I can incorportate that somehow.

      Some people fall from grace. I prefer a running start...