Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7077099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:22:51+00:00 2026-05-28T06:22:51+00:00

If i run this Python code: from Tkinter import *; w = Tk(); w.geometry(

  • 0

If i run this Python code:

from Tkinter import *; w = Tk(); w.geometry( "640x480" ); print( w.geometry() )

i will get “1×1+0+0” output. But if i start interpreter and execute this as two separate
commands, i will get completely different output:

>>> from Tkinter import *; w = Tk(); w.geometry( "640x480" ) 
'' 
>>> w.geometry() 
'640x480+101+73'

It seems geometry is not applied instantly, something else is needed :
(. Maybe anyone knows what i need to do in order to update geometry
inplace? I need it to correctly center/position main and child windows.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:22:51+00:00Added an answer on May 28, 2026 at 6:22 am

    Calling update_idletasks() on a window (or a widget) will force its geometry to update.

    Here’s a little text snippet from the Tkinter reference:

    The geometry is not accurate until the application has updated its idle tasks. In particular, all geometries are initially “1×1+0+0” until the widgets and the geometry manager have negotiated their positions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

/Users/smcho/Desktop/bracket/[10,20] directory has abc.txt, but when I run this Python code import glob import
In Python, when I run this code: from sys import argv script, user_name =argv
Under Python 3.1, when trying to run this code: from urllib import request def
How can I convert this code from C# to Python to be run on
I tried to run this code from the book 'Python Standard Library' of 'Fred
I made this code into an executable with py2exe: # File: zipfile-example-1.py from Tkinter
I want to start, from Python, some other Python code, preferably a function, but
I have the following python code: from django.db import models from datetime import datetime
I have the following situation in my python code: class Parent(object): def run(self): print
When I run this Python 3.1 code to access a device using telnetlib, it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.