#!perl -w use strict; use Tk 800.005; use Tk::TList; use Tk::DirTree; use Tk::Frame; use Tk::Scrollbar; use Tk::Adjuster; use vars qw/%tk/; $tk{mw} = MainWindow->new(-background => 'white'); $tk{mw}->geometry('500x400'); $tk{top_frame} = $tk{mw}->Frame; $tk{left_frame} = $tk{mw}->Frame; # # The first adjuster separates the left from the right # and since we want to control the left_frame size, we # assign the left_frame as the -widget. # $tk{adjuster} = $tk{mw}-> Adjuster(-widget=> $tk{left_frame}, -side=>'left'); $tk{right_frame} = $tk{mw}->Frame; $tk{dir_tree} = $tk{left_frame}->Scrolled('DirTree', -height=>'0', -width=>'0', -scrollbars=>'e', ); $tk{output_list} = $tk{right_frame}->Scrolled('TList', -height=>'1', -width=>'1', -scrollbars=>'osoe',); # # Create an adjuster that controls the right frame's top # widget, the output_list. The -side attribute specifies # which side the widget is on. # $tk{output_adjuster} = $tk{right_frame}-> Adjuster(-widget=> $tk{output_list}, -side=>'top'); $tk{user_list} = $tk{right_frame}->Scrolled('TList', -height=>'1', -width=>'1', -scrollbars=>'osoe',); # # Create an adjuster that controls the right frame's # use_list widget. # $tk{user_adjuster} = $tk{right_frame}-> Adjuster(-widget=> $tk{user_list}, -side=>'top'); $tk{group_list} = $tk{right_frame}->Scrolled('TList', -height=>'1', -width=>'1', -scrollbars=>'osoe',); $tk{dir_tree}->chdir( "." ); $tk{top_frame}->pack(qw/-side top -fill x/); $tk{left_frame}->pack(qw/-side left -fill y/); # # Use the normal pack for the first Adjuster # $tk{adjuster}->pack(qw/-side left -fill y/); $tk{right_frame}->pack(qw/-side right -fill both -expand 1/); $tk{dir_tree} ->pack(qw/-side left -fill both -expand 1/); $tk{output_list} ->pack(qw/-side top -fill both -expand 1/); $tk{user_list} ->pack(qw/-side top -fill both -expand 1/); $tk{group_list} ->pack(qw/-side top -fill both -expand 1/); # # Use packAfter here (see the Tk::Adjuster docs # for explanation) # $tk{user_adjuster}-> packAfter($tk{user_list},qw/-side top -fill y/); $tk{output_adjuster}-> packAfter($tk{output_list},qw/-side top -fill y/); MainLoop;