Help for this page

Select Code to Download


  1. or download this
       # $main is MainWindow
       my $canvas = $main->Scrolled('Canvas',
                                    -scrollbars => 'e', 
    ...
                                    -width => 200,
       )->pack;
       $canvas->packPropagate(0);
    
  2. or download this
       -scrollregion => [0,0,200,200],
    
  3. or download this
       my $frame = $main->Scrolled('Canvas',
                                    -scrollbars => 'e', 
    ...
       my $canvas = $frame->Subwidget('canvas');
       $canvas->configure(-height => 200, -width => 200);
       $canvas->packPropagate(0);
    
  4. or download this
       foreach (1..20) {
          $canvas(or $frame)->Label(-text => 'test')->pack;
       }
    
  5. or download this
       my $canvas = $main->Canvas(-height => 200,
                                  -width => 200,
    ...
                               -orient => 'vertical',
                               -command => ['yview' => $canvas],
       )->pack(-fill => 'y', -side => 'right');
    
  6. or download this
       ['yview', $canvas, 'scroll', 1, 'units']