From 541e03e2f1755a24fe7fe511b6e747f0e551ea2a Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Fri, 14 Dec 2018 23:46:18 -0500 Subject: [PATCH] Added close button hint setting if disable close set --- PySimpleGUIQt/PySimpleGUIQt.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/PySimpleGUIQt/PySimpleGUIQt.py b/PySimpleGUIQt/PySimpleGUIQt.py index d4e1861d..e1f2d322 100644 --- a/PySimpleGUIQt/PySimpleGUIQt.py +++ b/PySimpleGUIQt/PySimpleGUIQt.py @@ -5475,6 +5475,10 @@ def StartupTK(window): if window.DisableMinimize: window.QT_QMainWindow.setWindowFlags(window.QT_QMainWindow.windowFlags()&~Qt.WindowMinimizeButtonHint) window.QT_QMainWindow.setWindowFlags(window.QT_QMainWindow.windowFlags()&~Qt.WindowMaximizeButtonHint) + + if window.DisableClose: + window.QT_QMainWindow.setWindowFlags(window.QT_QMainWindow.windowFlags()&~Qt.WindowCloseButtonHint) + # window.QTWindow.setAttribute(Qt.WA_TranslucentBackground) # shadow = QtWidgets.QGraphicsDropShadowEffect() # shadow.setBlurRadius(9.0) @@ -5785,12 +5789,7 @@ class DebugWin(): self.output_element.Update(outstring, append=True) else: print(*args, sep=sepchar, end=endchar) - # TODO - # Add extra check to see if the window was closed... if closed by X sometimes am not told - # try: - # state = self.window.TKroot.state() - # except: - # self.Close() + def Close(self): self.window.Close()