I am writing a program in python (3.8.1) tkinter and I am trying to make a full-width frame, but whenever I use methods on the root to get the width, it returns 1x1+320+180
, but by looking at my code you can see that it's not the expected result (640).
from tkinter import *
root = Tk()
root.config(bg='#c0c0c0', relief=RAISED, bd=2) #sets background colour and stuff
root.attributes("-topmost", True) #stay on top
root.overrideredirect(1) #remove border
root.geometry('640x400+320+180') #set size of window
...
rootWidth = str(root.winfo_width()) #get size of window <<< ERROR HERE
print(root.wm_geometry())