From 33bf6d0060ecb265bcd93991d16bbc13b7d55356 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Sat, 5 Jan 2019 11:47:07 -0500 Subject: [PATCH] Window Alpha Channel! --- PySimpleGUIWx/PySimpleGUIWx.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/PySimpleGUIWx/PySimpleGUIWx.py b/PySimpleGUIWx/PySimpleGUIWx.py index e9042d2f..549fe123 100644 --- a/PySimpleGUIWx/PySimpleGUIWx.py +++ b/PySimpleGUIWx/PySimpleGUIWx.py @@ -3367,9 +3367,9 @@ class Window: :param alpha: From 0 to 1 with 0 being completely transparent :return: ''' - self._AlphaChannel = alpha + self._AlphaChannel = alpha*100 if self._AlphaChannel is not None: - self.QT_QMainWindow.setWindowOpacity(self._AlphaChannel) + self.MasterFrame.SetTransparent(self._AlphaChannel) @property def AlphaChannel(self): @@ -3377,9 +3377,9 @@ class Window: @AlphaChannel.setter def AlphaChannel(self, alpha): - self._AlphaChannel = alpha + self._AlphaChannel = alpha*100 if self._AlphaChannel is not None: - self.QT_QMainWindow.setWindowOpacity(self._AlphaChannel) + self.MasterFrame.SetTransparent(self._AlphaChannel) def BringToFront(self): self.QTMainWindow.activateWindow(self.QT_QMainWindow) @@ -5290,6 +5290,9 @@ def StartupTK(window): if window._Size != (None, None): window.MasterFrame.SetSize(window._Size[0], window._Size[1]) + if window._AlphaChannel is not None: + window.SetAlpha(window._AlphaChannel*100) + window.MasterFrame.Show()