Which frame are you trying to put scrollbars on? The mainwindow, or just on the popup frame which appears below? Or, do want the entire thing scrolled?
As mentioned above, you can use a Scrolled('Frame') or my favorite Scrolled('Pane'), to make your widgets scrolled.
If you want avoid using Tk::Scrolled, with it's automatic scrollbars added, this is how you would manually add a scrollbar to a widget. A basic example.
#!/usr/bin/perl use warnings; use diagnostics; use Tk; $top = MainWindow->new(); $car_list = $top->Listbox(-width => 15, -height => 4, )->pack(-side => 'left', -padx => 10); $car_list->insert('end', # Insert at end, the following list "Acura", "BMW", "Ferrari", "Lotus", "Maserati", "Lamborghini", "Chevrolet" ); # Create scrollbar, and inform it about the listbox $scroll = $top->Scrollbar(-orient => 'vertical', -width => 10, -command => ['yview', $car_list] )->pack(-side => 'left', -fill => 'y', -padx => 10); # Inform listbox about the scrollbar $car_list->configure(-yscrollcommand => ['set', $scroll]); MainLoop();
In reply to Re: Scrollbar in Frame
by zentara
in thread Scrollbar in Frame
by shortyfw06
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |