Search code examples
perltk-toolkitperltk

Horizontal scrollbar not working


use Tk;

my $mw=new MainWindow;

$mw->geometry("1024x768");

$mw->Scrolled("Text", -scrollbars => "s", -width => 30,-height=>10)->pack( );

MainLoop;

I need the help.The horizontal scrollbar is not working. What am I doing wrong?


Solution

  • What is the wrap mode of the text widget? If it's configured to wrap on word or character boundaries, the horizontal scrollbar won't ever be needed. For me, the default wrapping mode is char (i.e., wrap lines at character boundaries, like a terminal does) so I guess that's the default for you too, despite the fact that you're wanting it to be none (the only setting where a horizontal scrollbar is useful).

    Add -wrap => "none", to your options to Scrolled.