How to define a window's position (Tkinter)

H

Harlin Seritt

I am trying to use the geometry() method with the toplevel window
called root. I know that one can do the following:

root.geometry('400x400+200+200')

This will put the window in 200, 200 position with a size of 400x400.
Now, I don't really want to set the size. I simply want to set the
position of the window. I've tried this:

root.geometry('200+200')

However, this doesn't seem to work. What can I do to set the position
of the window without actually setting the size?

Thanks,

Harlin
 
R

Russell E. Owen

"Harlin Seritt said:
I am trying to use the geometry() method with the toplevel window
called root. I know that one can do the following:

root.geometry('400x400+200+200')

This will put the window in 200, 200 position with a size of 400x400.
Now, I don't really want to set the size. I simply want to set the
position of the window. I've tried this:

root.geometry('200+200')

However, this doesn't seem to work. What can I do to set the position
of the window without actually setting the size?

You were almost there, but you need an initial "+":
root.geometry("+200+200").

-- Russell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top