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

I have a PerlTk app which creates its initial window as follows:

#!/usr/bin/perl use strict; use Tk; use Tk::ROText; # ... snipped for brevity ... # main(); MainLoop(); quit(); sub main { $app = MainWindow->new(-height => 500, -width => 800); $app -> configure(-background => 'white'); $app -> title("Much To Do About Nothing"); $app -> formGrid(40,30);

Unfortunately, it does not honor the specified size, and I actually get a window around about 700x250 instead of 800x500.  Is this functionality broken?  Is there a way to make a PerlTk application honor the requested window size?

Replies are listed 'Best First'.
Re: Sizing a PerlTk app
by zentara (Cardinal) on Feb 27, 2006 at 17:32 UTC
    Passing -height and -width in on the new method, never worked as far as I know. You would think it should be that way, but no. Use a second command:
    $app->geometry("500x800+150+100")

    I'm not really a human, but I play one on earth. flash japh
      That does, indeed, work. So the documentation is in error in this regard, as the documentation is where I got that method from.