use Tk; use Tk::HList; use Tk::LabFrame; my $mw = MainWindow->new; my $gui_period_f = $mw->LabFrame( -label => "report month", -labelside => 'acrosstop', -relief => 'groove', -borderwidth => '5' ); my $b_period = $gui_period_f->Button( -text => "change year", -command => sub { &do_select_period }, -foreground => 'darkgrey' ); my $gui_period = $gui_period_f->Scrolled( qw/HList -background grey -scrollbars se -height 5 -width 35/ ); # $gui_period->bind( '' => \&show_period ); $gui_period->configure( -selectmode => 'single' ); $gui_period->configure( -browsecmd => \&show_period ); $gui_period->configure( -separator => '+' ); $gui_period_f->grid( -row => 1, -column => 0, -rowspan => 2, -sticky => 'nsew' ); $b_period->grid( -row => 1, -column => 0, -rowspan => 1, -sticky => 'nsew' ); $gui_period->grid( -row => 2, -column => 0, -rowspan => 1, -sticky => 'nsew' ); MainLoop; #### use Tkx; my $mw = Tkx::widget->new("."); my $gui_period_f = $mw->new_ttk__labelframe( -text => "report period", -labelanchor => 'ne', -relief => 'groove', -borderwidth => '5' ); my $b_period = $gui_period_f->new_ttk__button( -text => "change year", -command => sub { &do_select_period() }, #-foreground => $dark ); my $gui_period = $gui_period_f->new_ttk__treeview( #-background => 'grey', -height => 5, # -width => 35 ); my $gui_period_sbv = $mw->new_ttk__scrollbar( -command => [ $gui_period, "yview" ], -orient => "vertical" ); my $gui_period_sbh = $mw->new_ttk__scrollbar( -command => [ $gui_period, "xview" ], -orient => "horizontal" ); $gui_period->configure( -yscrollcommand => [ $gui_period_sbv, "set" ] ); $gui_period->configure( -xscrollcommand => [ $gui_period_sbh, "set" ] ); $gui_period_f->g_grid( -row => 1, -column => 0, -rowspan => 3, -columnspan => 2, -sticky => 'nwes' ); $b_period->g_grid( -row => 1, -column => 0, -sticky => 'nwes' ); $gui_period->g_grid( -row => 2, -column => 0, -sticky => 'nwes' ); $gui_period_sbv->g_grid( -row => 2, -column => 1, -sticky => 'ns' ); $gui_period_sbh->g_grid( -row => 3, -column => 0, -sticky => 'we' ); Tkx::MainLoop();