Python Tkinter删除标题栏
问题描述:
我正在寻找很长时间的解决方案。我想删除Tk窗口的标题栏,就像使用“overridedirect()”函数一样。我对该功能的问题是,操作系统的任务栏上没有图标。 我也尝试过使用“root.attributes(” - fullscreen“,1)”并试图缩小它,但这也不起作用。 我希望有人知道一个很好的解决方案,谢谢你的帮助!Python Tkinter删除标题栏
我的代码看起来有点像现在这样:
from tkinter import *
class Main(Frame):
def __init__(self, root):
**...**
#There are more classes after this one, but defined the same way
def main():
root = Tk()
root.geometry("800x400+0+0")
root.minsize(700, 400)
root.title("Title")
#root.overrideredirect(True)
#root.iconify()
##root.attributes('-topmost', 1)
##root.attributes("-fullscreen", 1)
##root.wm_state("zoomed")
if __name__ == "__main__":
main()
答
你想要什么你不能这样做。你可以没有标题栏和图标,也可以有标题栏和图标。没有另一个没有办法获得一个。