GrandFather has asked for the wisdom of the Perl Monks concerning the following question:

How do I set the main window to some specified size using Tk?

I'd assumed the following would do it, but it has no effect whatsoever:

$main->configure (-width => 500);

Perl is Huffman encoded by design.

Replies are listed 'Best First'.
Re: How to set main window size in Tk
by GrandFather (Saint) on Jul 19, 2005 at 00:52 UTC

    geometry does it:

    $main->geometry ('500x500');

    but I have to give a height as well. Can I change just the width?

    Yes, by:

    my $height = $main->reqheight; # or $main->height $main->geometry ('500x' . $height);
    Update: supply answer

    Perl is Huffman encoded by design.
Re: How to set main window size in Tk
by Anonymous Monk on Jul 19, 2005 at 00:30 UTC