• scrollbar subwidgets

    From fidokomik@21:1/5 to All on Thu Apr 5 05:36:14 2018
    Anybody know how to control subwidgets in Scrollbar? For example I want to color top arrow of yscrollbar red and bottom arrow green.

    -------------
    #!/usr/bin/perl

    use strict;
    use Tk;
    use Tk::ROText;

    our $mw = MainWindow->new();
    our $r=$mw->Scrolled('ROText',
    -highlightthickness=>0,
    -relief=>'sunken',
    -background=>'white',
    -width=>30,
    -height=>20,
    -scrollbars=>'e')->pack;
    foreach (1..50) {
    insert('end', "$_ Some text here.\n");
    }
    my $s=$r->Subwidget('yscrollbar');

    # this work
    configure(-width => 50, -bg => 'red');

    # but next command print nothing
    print $s->children,"\n";

    $mw->bind("<Escape>" => sub{$mw->destroy;});

    MainLoop;
    -------------

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From chrischavez@21:1/5 to fidokomik on Tue Jun 25 00:24:42 2019
    On Thursday, April 5, 2018 at 7:36:16 AM UTC-5, fidokomik wrote:
    Anybody know how to control subwidgets in Scrollbar? For example I want to color top arrow of yscrollbar red and bottom arrow green.


    This is old, but to try answering the question:

    The standard Scrollbar is implemented as a single widget, and is not composed of smaller individual subwidgets. (I imagine this has the benefit of having consistent appearance for each windowing system—X11, MS Windows—and reflecting any user
    preferences.)

    I'm not aware whether someone else has already created a customizable Scrollbar as you describe. Maybe a Scale widget and a couple of Button widgets for arrows is one alternative.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)