Tkinter's overrideredirect prevents certain events in Mac and Linux

僤鯓⒐⒋嵵緔 提交于 2019-11-29 03:44:11

I have submitted a bug report to Tk for this situation.

You can use the devilspie program to remove the decorations from your window. Use the wm title . myname command to give your window a specific name and use that name in the devilspie configuration fragment below. Remove the overrideredirect command from your program.

I have tested this (as a Tk program), and the undecorated window will still receive the keypress &etc. bindings.

Note that devilspie is written as a daemon process and stays active. The daemon can be killed after it is started and the window changes it made will still be in effect. Or it can be left running, and any time your window is activated, the devilspie configuration will be applied.

(if (is (application_name) "t.tcl")
   (begin (undecorate)))
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!