How can I make a Tkinter window take up all my display screen area?

Hi!

root = Tk()

w, h = root.winfo_screenwidth(), root.winfo_screenheight()
# use the next line if you also want to get rid of the titlebar
root.overrideredirect(1)
root.geometry("%dx%d+0+0" % (w, h))

Regards, mawe

Thanks mawe, that works well.

Just a question, if get rid of the titlebar, how can I exit the program?

Thanks mawe, that works well.

Just a question, if get rid of the titlebar, how can I exit the program?

You need to at Exit to your menu or add an exit button.

To exit, you can also use a key-binding. Look:

import Tkinter as tk

def exit(event):
    root.quit()

root = tk.Tk()
tk.Label(text="Press <ESC> to exit").pack()
root.bind("<Escape>", exit)
root.mainloop()

Just press the Esc-Key and ... that's it ;)

To exit, you can also use a key-binding. Look:

import Tkinter as tk
 
def exit(event):
    root.quit()
 
root = tk.Tk()
tk.Label(text="Press <ESC> to exit").pack()
root.bind("<Escape>", exit)
root.mainloop()

Just press the Esc-Key and ... that's it ;)

Thanks, that works well.

Just a question, when do you use root.quit() and root.destroy()? I have seen them both.

This question has already been answered. Start a new discussion instead.