【问题标题】:Launch Tkinter with undecorated window使用未装饰的窗口启动 Tkinter
【发布时间】:2016-05-12 20:53:19
【问题描述】:

使用 Python 2 和 Tkinter,如何使 Tk 窗口在窗口上方没有标题栏的情况下启动?

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()

【问题讨论】:

    标签: python tkinter


    【解决方案1】:

    您可以使用 .overrideredirect() 删除 Tkinter 窗口(@98​​7654323@ 或 Toplevel)中的所有装饰:

    root = Tk()
    root.overrideredirect(True)
    

    【讨论】:

    猜你喜欢
    • 2011-12-29
    • 1970-01-01
    • 1970-01-01
    • 2015-03-21
    • 2012-06-02
    • 2012-10-23
    • 2017-12-05
    • 1970-01-01
    • 2020-08-02
    相关资源
    最近更新 更多