小编mic*_*chk的帖子

python tkinter覆盖重定向;无法接收击键 (Linux)

我有一个想要全屏运行的 python tkinter 应用程序。当我取消对 overrideredirect 的注释时,窗口管理器(Gnome、Linux)将无法再将击键转发到应用程序。

(片段,蟒蛇)

# 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)
Run Code Online (Sandbox Code Playgroud)

我找到了用于 Tcl/Tk 的 window::or 包,它应该可以解决这个错误。我将如何安装它,是否可以在我的 python 应用程序中使用它?

http://www.binarism.com/tk/window/or/

http://www.binarism.com/tk/window-or-0.1.1.tgz

python tkinter

4
推荐指数
1
解决办法
4622
查看次数

标签 统计

python ×1

tkinter ×1