Tkinter Alpha 帮助
我有一个 python 程序,它没有窗口框架,并且由于 self.overrideredirect(1) 而没有显示在任务栏中。该程序有一个选项菜单(顶级小部件),允许使用 self.attributes("-alpha", 0.85) 调整 alpha。但是,当我关闭选项菜单时,我的程序会显示在任务栏中。显然我不希望它这样做。我尝试在选项菜单关闭后调用 self.overrideredirect(1) 命令,但无济于事。有谁有解决方案/知道可以从任务栏中删除我的程序的行吗?
I have a python program that has no windows frame and doesn't show up in the taskbar because of self.overrideredirect(1). This program has an options menu (a top level widget) that allows for the alpha to be adjusted with self.attributes("-alpha", 0.85). However when I close out of the options menu my program shows up in the task bar. Obviously I don't want it to do this. I tried invoking the self.overrideredirect(1) command after the options menu was closed, but to no avail. Does anyone have a solution/ know of a line that will remove my program from the task bar?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以轻松地做到这一点,只需复制此代码即可。
You can do this with ease, just copy this code.
如果更改覆盖重定向标志,则需要撤回窗口,然后取消图标化窗口,以便窗口管理器有机会进行更改。你可以尝试一下。
另外,当您说“关闭”顶级选项菜单时,您到底是什么意思?您确定要摧毁第二个顶层窗口吗?
If you change the override redirect flag you need to withdraw and then deiconify the window to give the window manager a chance to make the change. You might try that.
Also, when you say "close out" the option menu top-level, what exactly do you mean? Are you sure destroying this second top-level window?