im trying to display the size(dimension) of the root window (top level window) on a label. whenever the user resize the window, new window dimensions should be displayed on the label. I tried to bind the event for the root window but im getting an error as follows
TclError: bad event type or keysym "configure"
the code i used is given below. Its just a rough sample. Can anyone help me what im doing wrong.
def main():
root=Tk()
root.title("Test Numbers")
root.geometry("550x350")
def d(event):
print event.width,event.height
root.bind('<configure>',d)
root.mainloop()
if __name__=="__main__":
main()
There ought to be capital C
root.bind( "<Configure>", d )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With