in reply to Re^2: How to resize mainwindow automatically
in thread How to resize mainwindow automatically

if you would be kind enough to put the entire runnable code example into a single code block, i might be able to help you...... at first glance you mix grid and pack...... i don't think it is wise to mix layout managers

....as far as auto-resizing goes, resizing the mainwindow is usually a bad option..... what you should do, is pack your buttons in a Scrolled Pane, and let the scrolled pane adjust the size of the scroll region to accomodate extra buttons......or look at the following

#!/usr/bin/perl use strict; use Tk; my $mw = tkinit; my %cb; my $f = $mw->Frame->pack(-anchor => 'w'); foreach (qw/Author Reviewer File Status Mine/) { $cb{$_} = $f->Checkbutton(-text => $_)->pack(-anchor => 'w'); } my $on_off = 1; foreach (['Enable', 1], ['Disable', 0]) { $mw->Radiobutton( -text => $_->[0], -command => [\&ChangeAuthor, $_->[1]], -variable => \$on_off, -value => $_->[1], )->pack(-side => 'left'); } MainLoop; sub ChangeAuthor { if (shift) { $cb{Author}->pack(-before => $cb{Reviewer}, -anchor => 'w'); } else { $cb{Author}->packForget; } }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku