in reply to -scrollbars is unknown option in windowCreate

I have specified 'use Tk' and 'require Tk::ROText'.

$row0p2 = $top->ROText(-height =>8, -width => 22, -wrap => 'word', -scrollbars => 'oe')->pack;

will produce a widget with working scrollbars. It is just when I try to insert new text widget into another with windowCreate I get the error.

Replies are listed 'Best First'.
Re^2: -scrollbars is unknown option in windowCreate
by AnomalousMonk (Archbishop) on Jul 15, 2018 at 22:25 UTC
    $row0p2 = $top->ROText(-height =>8, -width => 22, -wrap => 'word',
    -scrollbars => 'oe')->pack;

    will produce a widget with working scrollbars.

    I don't have the latest version of Tk (804.034) and my Tk::ROText does not support the  -scrollbars option, so I'm afraid I can't help further with windowCreate.

    c:\@Work\Perl\monks>perl -wMstrict -le "use Tk; use Tk::ROText; ;; print 'Perl/Tk version: ', $Tk::VERSION; ;; my $MW = tkinit; ;; my $row0p2 = $MW->ROText(-height =>8, -width => 22, -wrap => 'word', -scrollbars => 'oe')->pack; ;; $row0p2->insert('end', '[ ' . 'long description ' x 80 . ']'); ;; MainLoop; " Perl/Tk version: 804.03 Tk::Error: Can't set -scrollbars to `oe' for Tk::ROText=HASH(0x285580c +): Bad option `-scrollbars' at C:/strawberry/5.14/perl/site/lib/Tk/Configure.pm line 45. at C:/strawberry/5.14/perl/site/lib/Tk/Derived.pm line 294. Tk callback for event Tk callback for . Tk callback for .rotext Tk::Derived::configure at C:/strawberry/5.14/perl/site/lib/Tk/Derived +.pm line 306 Tk::Widget::new at C:/strawberry/5.14/perl/site/lib/Tk/Widget.pm line + 205 Tk::Widget::__ANON__ at C:/strawberry/5.14/perl/site/lib/Tk/Widget.pm + line 256 Can't set -scrollbars to `oe' for Tk::ROText=HASH(0x285580c): Bad opti +on `-scrollbars' at C:/strawberry/5.14/perl/site/lib/Tk/Configure.pm +line 45. at C:/strawberry/5.14/perl/site/lib/Tk/Derived.pm line 294. at C:/strawberry/5.14/perl/site/lib/Tk/Derived.pm line 306.


    Give a man a fish:  <%-{-{-{-<

Re^2: -scrollbars is unknown option in windowCreate
by Oberbee (Novice) on Jul 16, 2018 at 15:54 UTC

    I have found an acceptable workaround for the problem. By using Tk::Pane the entire main window is scrollable and the scrollbars inside the ROText widget are still functional. The downside is that the widgets at the top of my window also scroll out of view. Since the main focus of the window is the long list of items I can live with this.

    #! /usr/bin/perl -w use Tk; use Tk::Pane; require Tk::ROText; my $mw = MainWindow->new; $pane = $mw->Scrolled(Pane, -scrollbars => 'ow', -sticky => 'nswe', -gridded => 'y', -height => '800' ); $pane->Frame(); $pane->grid; $pos1 = $pane->ROText(-height => 7, -width => 20, -wrap => 'word')->gr +id ( $pos2 = $pane->ROText(-height => 7, -width => 20, -wrap => 'word +'), $pos3 = $pane->Scrolled('ROText', -height =>7, -width => 20, -wrap + => 'word', -scrollbars => 'oe'), $pane->Label(-height => 100, -width => 100,-text => "Photo" ), $pane->Button(-text => "Link"), -sticky => "nsew"); $pos1->tagConfigure('bold', -font => "Courier 10 bold", -justify => " +center", -spacing1 => 50); $pos2->tagConfigure('bold', -font => "Courier 10 bold", -justify => " +center", -spacing1 => 30); $pos1->insert('end', "Evening Gown", 'bold'); $pos2->insert('end', "Blue and black formal dress", 'bold'); $pos3->insert('end', " [Long description] "); MainLoop;