Hi there dear monks,

I've seem to have stumbled on a problem I can't get solved. My script is a basic "input-convert-to-output" script and it works fine. The problem is the GUI i wrote that makes handling the script a little easier. The GUI itself works fine (again), but the troubles begin when i move the script to another computer that has a different screen-resolution. It doesn't matter whether or not the OS of the computer is the same (linux, mac or windows), the only thing that seems to influence (and alter) the GUI appearance is the resolution.

For some reason, the GUI MainWindow becomes either smaller or larger, while the widgets inside the MainWindow remain 'normal', causing the GUI to look terrible (seeing buttons and frames vanish cause of a very small mainwindow is not very good). I've searched the internet for hours, read perl books,... but I can't seem to find any information about how to 'solidify' (in a lack of better terms) the width and height of the mainwindow (so not the widgets inside it). Apparently I can't use centimeters, inches or any other form of solid distance measurements for the geometry() function at the mainwindow. I tried but failed miserably :)

Therefore, the obvious question is: can someone help me here and try to fix this.

#only a small relevant portion is shown here my $mw = MainWindow->new; my $width = '350'; my $height = '180'; $mw->geometry( $width."x".$height); $mw->resizable(0,0); $mw->title("Calculator");

In reply to Perl Tk geometry problem by lollysticky

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.