0

I am looking to make a transparent GUI on top of a fullscreen game application. I have looked and studied this post on SO: How to make window overlay (on top of browser,games exc.) with wxPython

I tried it out - and unfortunately it works well to show a transparent GUI when you are working on a desktop , but when you are running a fullscreen application the transparent window is hidden.

Can this be done with wxPython? If not, is there another toolkit or method people are aware of?

RenegadeAndy
  • 5,440
  • 18
  • 70
  • 130

1 Answers1

1

You could use

https://github.com/wxWidgets/Phoenix/blob/master/demo/Overlay.py

in combination with the wxNativeWindow.

Not sure it this is implemented in the Python wrapper though, it is listed here but not linked.

See also at How to make a wx window parent of another application's window?

Joe
  • 6,758
  • 2
  • 26
  • 47
  • Hi Joe, this looks very promising! Can you talk me through making this example extended to include the wxNativeWindow you reference? Perhaps through an example? – RenegadeAndy Nov 08 '19 at 12:16
  • Have you checked if the wxNativeWindow is implements in wxPython? – Joe Nov 08 '19 at 13:37
  • I see this : https://docs.wxpython.org/wx.GraphicsContext.html?highlight=nativewindow#wx.GraphicsContext.CreateFromNativeWindow but am really not well placed to know if this is what you refer to. – RenegadeAndy Nov 08 '19 at 17:27
  • I also saw that, it probably uses the wxNativeWindow behind the scenes. But you have to check in the sources. I could not find it. You can try https://discuss.wxpython.org/ – Joe Nov 08 '19 at 19:37
  • Is there some other alternative method using some other Python bindings or libraries @joe? – RenegadeAndy Nov 08 '19 at 20:18
  • Do you have to use wx? If not, PyQt 5. – Joe Nov 08 '19 at 20:19
  • Then have a look at PyQt 5. – Joe Nov 08 '19 at 20:23
  • https://stackoverflow.com/questions/25950049/creating-a-transparent-overlay-with-qt – Joe Nov 08 '19 at 20:25
  • https://stackoverflow.com/questions/12334217/python-qt-2d-overlay-over-other-full-screen-app – Joe Nov 08 '19 at 20:25
  • Those don't look promising, the first failing on fullscreen modes (same as my solution) and the second with no answer. Ideally this would work on Mac OSX and Windows as a solution. – RenegadeAndy Nov 08 '19 at 20:29
  • https://github.com/electron/electron/issues/10547#issuecomment-331747125 – Joe Nov 08 '19 at 20:43
  • Qt looks really promising -- with this https://doc.qt.io/qt-5/qwindow.html#fromWinId. Would that work in PyQT? – RenegadeAndy Nov 08 '19 at 21:21
  • https://gist.github.com/chipolux/acf28d367822e20cc62672f49eb1aab7 – Joe Nov 09 '19 at 07:17
  • https://stackoverflow.com/questions/45061803/cannot-get-qwindowfromwinid-to-work-properly – Joe Nov 09 '19 at 07:18
  • https://programtalk.com/python-examples/PyQt5.QtGui.QWindow.fromWinId/ – Joe Nov 09 '19 at 07:18