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

I am trying to create a GUI window using perl. But the created GUI window size differs in different system.

Could anyone please tell me, how to set the fixed size, so that, it won't change depends on the following factors,
- Any resolution we set in our desktop
- Any system we use
- Any OS we use

use Tkx; my $MainWindow = Tkx::widget -> new("."); $MainWindow -> g_wm_geometry("600x15+340+612"); $MainFrame = $MainWindow -> new_ttk__frame(); $ExtractionTypeLabel = $MainFrame -> new_ttk__label(-text => <<TEXT>>, -padding => 10, ); $ExtractionTypeSingle = $MainFrame -> new_ttk__radiobutton(-text =>$Co +nfMainSingleExtractionText, -variable => \$ExtractionTypeVal, -value => $ConfMainSingleExtractionText, -command => \&SINGLE_RADIO_BUTTON_LISTENER, ); ##### ALIGNMENT IN GRID LAYOUT ##### $ExtractionTypeLabel -> g_grid(-row => 3, -column => 0, -pady => 1); $ExtractionTypeSingle -> g_grid(-row => 4, -column => 0, -ipadx => 4); ##### PACK ##### $MainFrame -> g_pack(-in => $MainWindow); Tkx::MainLoop(); exit;

Replies are listed 'Best First'.
Re: How to set a fixed GUI window size using Perl Tkx
by ww (Archbishop) on May 05, 2014 at 12:43 UTC
    1. Please tell me how to make the mosquitos look the same size as the Pterodactyls.
    2. Please make the stars render at the same (apparent) size as the sun.
       
      or, more seriously,

    please define "fixed size": do you mean the "GUI window" should have the same dimensions in linear measure (centimeters, inches, etc) or do you mean that the window should have (in all cases) the same pixel counts, horizontally and vertically?

    Then consider the unlikelihood that you can do the former without interrogating the system where your package is running for resolution and calculating+performing the necessary adjustments.

    If you get stuck somewhere whilst coding that, please come back (with code, error messages and a cogent description of your problem) for help.


    Questions containing the words "doesn't work" (or their moral equivalent) will usually get a downvote from me unless accompanied by:
    1. code
    2. verbatim error and/or warning messages
    3. a coherent explanation of what "doesn't work actually means.

    check Ln42!

Re: How to set a fixed GUI window size using Perl Tkx
by Anonymous Monk on May 05, 2014 at 10:30 UTC

    But the created GUI window size differs in different system.

    Because the different systems have different font settings, right?