How to make python window run as “Always On Top”?

南楼画角 提交于 2019-11-28 09:23:07

The question is more like which windowing toolkit are you using ? PyGTK and similar educated googling gave me this:


gtk.Window.set_keep_above

As mentioned previously it is upto the window manager to respect this setting or not.

Edited to include SDL specific stuff Pygame uses SDL to do display work and apprently does not play nice with Windowing toolkits. SDL Window can be put on top is discussed here.

I really don't know much Python at all, but Googling "pygtk always on top" gave me this:

http://www.mail-archive.com/pygtk@daa.com.au/msg01370.html

The solution posted there was:

transient.set_transient_for(main_window)

You might also want to search things like "x11 always on top". The underlying concept seems to be that you're giving the window manager a "hint" that it should keep the window above the others. The window manager, however, has free reign and can do whatever it wants.

I've also seen the concept of layers when using window managers like Fluxbox, so maybe there's a way to change the layer on which the window appears.

I was trying to figure out a similar issue and found this solution using the Pmw module

http://www.java2s.com/Code/Python/GUI-Pmw/Showglobalmodaldialog.htm

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