2

Currently, I am using graphics.py, a simple graphics library based on Tkinter:

I can create a graphics window:

from graphics import GraphWin 

winmap2 = GraphWin("Details", 200, 200)
winmap2.setBackground("Black")

How can I set the x, y coordinates of the window's position on my screen?

nbro
  • 13,796
  • 25
  • 99
  • 185
McFrisch
  • 23
  • 1
  • 4

1 Answers1

2

GraphWin is in fact a tkinter Canvas. Therefore you can use the same method than How to specify where a Tkinter window opens?

from graphics import GraphWin

winmap2 = GraphWin("Details", 200, 200)
winmap2.setBackground("Black")

x = 200
y = 100
winmap2.master.geometry('%dx%d+%d+%d' % (200, 200, x, y))
winmap2.mainloop()
Community
  • 1
  • 1
Eric Levieil
  • 3,474
  • 2
  • 12
  • 18