I have a problem where when I create a window in Tkinter, it is offset a bit to the side instead of centered. I was wondering if there was some way to center the window without using too many lines of code. I've tried using .eval('tk::PlaceWindow . center')
, but it just sets the top left edge of the window to the center. I've also tried calculating the size of the window and placing it with .geometry().
Here I have a button that creates a window when clicked:
from Tkinter import *
button = Button(lambda:newWind(title))
#function being called
def newWind(bPressed):
newApp = tk.Tk()
newApp.title(bPressed)
newApp.geometry('1920x1080')
The window is offset by about 10 pixels when created. Any easy and short way I can fix this?