Sorry for the vague title, couldn’t come up with anything more informative %)
What I want is a 5px horizontal panel on the top of the screen that I can draw on (and, possible, handle clicks on too).
One of the following features would be awesome (although I understand it’s probably not really possible to combine both of them):
- the panel should be just like the Windows’s own taskbar, i.e., maximized windows should not overlap it, but start below it instead
- the panel should show in fullscreen apps too
Is it possible to do this in Python?
Thanks.
Yes, it’s possible. The “how” part depends on the GUI library you choose for which there are many options, but most people will recommend the following two: wxPython or PySide which is Qt for Python.
PySide has good documentation and tutorials.
What you will want to do is create a QMainWindow instance and set the WindowFlags to your requirements. You probably want the following combination
Qt::Window | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint.Something like this:
Note, that there is a limit to the “staying on top” nature of such windows. There are Win32-specific ways to fight it and get even higher, but such requirement would be a design error.