2

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.

Bryan Oakley
  • 341,422
  • 46
  • 489
  • 636
Jan Muric
  • 39
  • 1
  • 2

2 Answers2

9

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
  • 341,422
  • 46
  • 489
  • 636
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)

Mamad Love
  • 87
  • 4