in reply to Tk autosizing Scrolled widgets
If I understand your question (and I'm pretty sure I don't), you are trying to make a grid of widgets that has a fixed minimum size but will expand as the main window expands. I don't think you really want to put the grid in a HList because that's for hierarchical lists like directories, not grids. Here's a grid based Tk app that does what I think you want.
#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11136705 use warnings; use Tk; use Tk::Pane; my $mw = MainWindow->new(); $mw->geometry("+0+0"); $mw->maxsize(1000,1200); $mw->minsize(400,300); my $scroll = $mw->Scrolled('Pane', -scrollbars => 'osoe', -sticky => 'news', )->pack(-expand => 1, -fill => 'both'); my $f = $scroll->Frame->pack(-expand => 1, -fill => 'both'); foreach my $row (0..10) { foreach my $col (0..12) { $f->Entry( -text => "rc $row $col", -width => 0, )->grid(-row => $row, -column => $col, -sticky => 'news'); $row or $f->gridColumnconfigure($col, -weight => 1); } $f->gridRowconfigure($row, -weight => 1); } MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tk autosizing Scrolled widgets
by Marshall (Canon) on Sep 13, 2021 at 23:44 UTC |