【发布时间】:2011-08-18 16:20:36
【问题描述】:
我有一个 python tkinter 应用程序,我想全屏运行。当我取消注释 overrideredirect 时,窗口管理器(Gnome、Linux)将无法再将击键转发到应用程序。
(片段,python)
# make it cover the entire screen
w, h = master.winfo_screenwidth(), master.winfo_screenheight()
self.root.geometry("%dx%d+0+0" % (w, h))
self.root.focus_set() # <-- move focus to this widget
self.root.bind('<Escape>', self.root.quit())
#self.root.overrideredirect(True)
我找到了 Tcl/Tk 的 window::or 包,它应该可以解决这个错误。我将如何安装它,是否可以在我的 python 应用程序中使用它?
【问题讨论】: