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

how can i create a scrollbar in the main window, using perl tk.
  • Comment on how can i create a scrollbar in the main window using perl tk

Replies are listed 'Best First'.
Re: how can i create a scrollbar in the main window using perl tk
by kutsu (Priest) on Dec 18, 2008 at 07:01 UTC

    Check the documentation, you can find an example at the More Callbacks link.

Re: how can i create a scrollbar in the main window using perl tk
by imrags (Monk) on Dec 18, 2008 at 07:16 UTC
    Hi, You can use "use Tk::Scrolled"; and then followed by something like this
    my $mw = MainWindow->new(); my ($listbox) = $mw->Scrolled('Listbox',-height=>0, -width=>0, -scroll +bars => 'se')->pack();
    Njoi
    Raghu
      I dont want to associate any widget(listbox) to the scrollbar. I just want to have a scrollbar that will appear in the main window when it is populated, e.g with other frames (containing widgets like table, entry) that appears on the main window after pressing some buttons on the main window and disappears, pressing those buttons again. Any help !! Thanks in Advance.
        Then you can try something like this:
        $mw->Scrollbar()->pack(-side => 'right', -fill => 'y');
        And then you can associate it with any widget. Check out: PerlTK
        Njoi
        Raghu