vikee has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I'm very new to Tk so I would like to ask few things:
I have a scrolled widget with scrollbar on the right.
when you click a button it starts to search for files and to insert checkboxes to the Scrolled widget. the problem is that after adding the checkboxes it cant be scrolled (also before it was empty).
my $sf_makefiles = $canvas3->Scrolled(qw/Canvas -relief flat -width 190 -height 110 -scrollbars e/)->pack(-expand => 1,-fill => 'both'); foreach $file (sort @makefiles) { $sf_makefiles->Checkbutton(-text => $file)->pack(-side => 'top', -anchor => 'nw'); }
Please help,thanks please send your answer to "vikee at ynet.sk" too,thx

Replies are listed 'Best First'.
Re: Tk Scrolled problem
by eserte (Deacon) on Jun 18, 2004 at 11:09 UTC
    You have also to set the scrollregion of the canvas. The easiest is to write

    $sf_makefiles->configure(-scrollregion => [ $sf_makefiles->bbox("all") ])

    However this may or may not work if you're not creating "real" canvas items. Is there a reason why you're using a Canvas and not a Pane?

      thanks for answer, I'll try.
      
      >Is there a reason why you're using a Canvas and not a Pane? 
      
      No, it was the first thing I'd tried. 
      
      hello, it didn't work. So I replaced Canvas with Pane, scrollregion is not needed and it works thanks. :-)