I hope this snippet will help you.

#-- Just for clarity, here is the hash array used in the snippet my %_MAINWIN = ( 'title' => 'Oracle User Manager for Baan ('.$_VERSION.')' +, 'width' => 790, 'height' => 565, 'row_height' => 25, 'radioratio' => 1.0, 'buttonratio' => 1.0, ); #-- Create and center the main window $mMainWindow = MainWindow->new; $mMainWindow->title($_MAINWIN{title}); $mWinX = int(($mMainWindow->screenwidth-$_MAINWIN{width})/2); $mWinY = int(($mMainWindow->screenheight-$_MAINWIN{height})/2); $mMainWindow->geometry ( $_MAINWIN{width} . 'x' . $_MAINWIN{height} . '+' . $mWinX . '+' . $mWinY ); $mMainWindow->resizable($_FALSE, $_FALSE);

Anyway, the quick answer is centering is done with geometry. Please post here if you have additional questions (or if I missed the actual question. *Smiles*)

Update Yeah, what MZSanford said... *Smiles*


In reply to Missed your question the first time... by Rhose
in thread Previously asked Tk question by slojuggler

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.