Advanced Search
Mail us
Home    Manuel    Links    Faq    Submit a tcl/tk Reference    Contact Us

    Some examples tcl/tk codes     Man of Bwidget     Man of blt     mkwidget screenshots     TkOgl     Video Demo real.

  How can I get the geometry of my window (I get 1x1+0+0)?
 If you start wish interactively and type:

puts [wm geometry .]

you will get something like:


The actual numbers may vary depending on X11 defaults, window managers,
etc. If you put the same thing in a script, though:

puts [wm geometry .]

You will instead get this:


This will happen because you are requesting geometry information before
the window has actually been drawn.  In general, before you start asking
about window sizes, use the `update` command so that the geometries of
the windows can be resolved.  Changing the above script to this will
give the expected results:

puts [wm geometry .]