Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch Tkinter with undecorated window

Tags:

python

tkinter

Using Python 2 and Tkinter, how can I make the Tk window launch without the title bar above the window?

from Tkinter import *

root = Tk()
frame = Frame(root)
frame.pack()

bottomframe = Frame(root)
bottomframe.pack( side = BOTTOM )

redbutton = Button(frame, text="Red", fg="red")
redbutton.pack( side = LEFT)

greenbutton = Button(frame, text="Brown", fg="brown")
greenbutton.pack( side = LEFT )

bluebutton = Button(frame, text="Blue", fg="blue")
bluebutton.pack( side = LEFT )

blackbutton = Button(bottomframe, text="Black", fg="black")
blackbutton.pack( side = BOTTOM)

root.mainloop()
like image 699
Yousef Abdelsalam Avatar asked May 03 '26 20:05

Yousef Abdelsalam


1 Answers

You can remove all decoration from a Tkinter window (Tk or Toplevel) by using .overrideredirect():

root = Tk()
root.overrideredirect(True)
like image 148
Uyghur Lives Matter Avatar answered May 06 '26 08:05

Uyghur Lives Matter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!