Merge pull request #1435 from PySimpleGUI/Dev-latest

Added check toi automatically close hidden window when last window is…
This commit is contained in:
MikeTheWatchGuy 2019-05-17 08:42:39 -04:00 committed by GitHub
commit ff1bcf551e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 10 deletions

View File

@ -4097,6 +4097,13 @@ class Window:
# _my_windows.Decrement()
except:
pass
# if down to 1 window, try and destroy the hidden window, if there is one
if Window.NumOpenWindows == 1:
try:
Window.hidden_master_root.destroy()
Window.NumOpenWindows = 0 # if no hidden window, then this won't execute
except:
pass
CloseNonBlockingForm = Close
CloseNonBlocking = Close
@ -4503,16 +4510,6 @@ def EncodeRadioRowCol(container, row, col):
RadValue = container*100000 + row * 1000 + col
return RadValue
# --------------------------------------------------------------#
# Closes the hidden master window so PySimpleGUI can be closed #
# --------------------------------------------------------------#
def ClosePySimpleGUI():
Window.hidden_master_root.destroy()
Window.DecrementOpenCount()
# ------- FUNCTION BuildResults. Form exiting so build the results to pass back ------- #
# format of return values is
# (Button Pressed, input_values)