Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
关闭未装饰的框架tkinter python_Python_Python 2.7_User Interface_Tkinter - Fatal编程技术网

关闭未装饰的框架tkinter python

关闭未装饰的框架tkinter python,python,python-2.7,user-interface,tkinter,Python,Python 2.7,User Interface,Tkinter,我正在用python中的tkinter制作UI。我想为我的UI创建一个全屏窗口,没有任何标题或边框,就像Java中未装饰的框架一样。如我使用的 它工作得很好,我有一个全屏窗口,但是我不能使用像ALt+F4这样的正常关闭操作来关闭这个窗口,这与Java中未装饰的帧不同。我需要添加使用键盘Alt+F4键关闭OverrideDirect窗口的功能。我该怎么做 如果无法添加该功能,我是否可以使用另一种方法,使用任何其他命令创建全屏窗口,以使我具有关闭Alt+F4键功能对于我来说,Alt+F4对于未装饰的

我正在用python中的tkinter制作UI。我想为我的UI创建一个全屏窗口,没有任何标题或边框,就像Java中未装饰的框架一样。如我使用的

它工作得很好,我有一个全屏窗口,但是我不能使用像ALt+F4这样的正常关闭操作来关闭这个窗口,这与Java中未装饰的帧不同。我需要添加使用键盘Alt+F4键关闭OverrideDirect窗口的功能。我该怎么做


如果无法添加该功能,我是否可以使用另一种方法,使用任何其他命令创建全屏窗口,以使我具有关闭Alt+F4键功能

对于我来说,Alt+F4对于未装饰的窗口工作正常,因此我不确定您出了什么问题。 也就是说,你当然可以制作一个破坏窗口的按钮。这可能是最好的方式,因为不是每个人都熟悉(简单的)键盘快捷键

self.button_quit = Tk.Button(self.root, text='Quit', command=self.quit).pack

def quit(self):
    self.root.destroy()
self.button_quit = Tk.Button(self.root, text='Quit', command=self.quit).pack

def quit(self):
    self.root.destroy()