The title says it all. How to move the entire window to a place on the screen using tkinter. This should be moving the root frame.
Asked
Active
Viewed 1.1k times
4
-
use [.geometry() method](http://stackoverflow.com/a/11093235/4279) – jfs Aug 03 '15 at 22:10
2 Answers
10
Use the geometry method of the root (or any Toplevel) window. For example:
import tkinter as tk
root = tk.Tk()
root.geometry("+200+400") # places the window at 200,400 on the screen

Bryan Oakley
- 370,779
- 53
- 539
- 685
4
use this:
from tkinter import Tk
main=Tk()
main.geometry('+100+200')
main.mainloop()
or do it with function :
def change_position(root_variable,x,y):
root_variable.geometry('+{}+{}'.format(x,y))
and use :change_position(main,500,400)
edit: added dot for format

Community
- 1
- 1

Mohammad Chenarani
- 85
- 5