fix: position the window to the centre of screen
This commit is contained in:
parent
ccdffe00bf
commit
340eec773d
1 changed files with 7 additions and 0 deletions
|
@ -42,6 +42,13 @@ class Window:
|
|||
self.__root.title("Maze Solver")
|
||||
self.__root.protocol("WM_DELETE_WINDOW", self.close)
|
||||
|
||||
# Position the window to the centre of the screen
|
||||
screen_width = self.__root.winfo_screenwidth()
|
||||
screen_height = self.__root.winfo_screenheight()
|
||||
centre_x = int(screen_width/2 - width/2)
|
||||
centre_y = int(screen_height/2 - height/2)
|
||||
self.__root.geometry(f"{width}x{height}+{centre_x}+{centre_y}")
|
||||
|
||||
self.__canvas = Canvas(self.__root)
|
||||
self.__canvas.config(
|
||||
bg="white",
|
||||
|
|
Loading…
Reference in a new issue