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
  • 15,395
  • 32
  • 113
  • 196
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,554
  • 2
  • 13
  • 18