Using Perl Tkx, I'm attempting to create a window with a treeview widget and a scrollbar to the right of it. I need the treeview widget to automatically resize when the user resizes the window.
This is what I have:
my $mw = Tkx::widget->new(".");
my $frm = $mw->new_ttk__frame(-padding => "2 6 12 12");
$frm->g_grid(-column => 0, -row => 0, -sticky => "nwes");
$frm->g_pack(-expand => 1, -fill => 'both');
my $tree = $frm->new_ttk__treeview;
$tree->g_grid(-column => 1, -columnspan => 5, -row => 1, -sticky => "we");
$tree->g_pack(-expand => 1, -fill => 'both');
my $scrollbar = $frm->new_ttk__scrollbar(-orient => 'vertical', -command => [$tree, 'yview']);
$scrollbar->g_grid(-column => 6, -row => 1, -sticky => "we");
$scrollbar->g_pack(-expand => 1, -fill => 'both');
$tree->configure(-yscrollcommand => [$scrollbar, 'set']);
Both widgets are displayed in the window, and the resizing works, but unfortunately the scrollbar is placed underneath the tree, not to the right of it. If I remove the three g_pack(-expand => 1, -fill => 'both')
lines, the positioning is correct, but the resizing doesn't work. How can I place the scrollbar to the right of the tree, and have the automatic resizing work?