Merge pull request #1434 from PySimpleGUI/Dev-latest

New function - ClosePySimpleGUI() - deletes the hidden master window
This commit is contained in:
MikeTheWatchGuy 2019-05-17 08:25:49 -04:00 committed by GitHub
commit f95eca095e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 1 deletions

View File

@ -62,6 +62,14 @@ def TimerStop():
PEP8 - this code is far far from PEP8 compliant.
It was written PRIOR to learning that PEP8 existed.
I'll be honest.... started learning Python in Nov 2017, started writing PySimpleGUI in Feb 2018.
Released PySimpleGUI in July 2018. I knew so little about Python that my parameters were all named
using CamelCase. DOH! Someone on Reddit set me straight on that. So overnight I renamed all of the
parameters to lower case. Unfortunately, the internal naming conventions have been set. Mixing them
with PEP8 at this moment would be even MORE confusing.
Code I write now, outside PySimpleGUI, IS PEP8 compliant.
The variable and function naming in particular are not compliant. There is
liberal use of CamelVariableAndFunctionNames. If you've got a serious enough problem with this
that you'll pass on this package, then that's your right and I invite you to do so. However, if
@ -3937,7 +3945,7 @@ class Window:
'window.FindElement("{}")'.format(key))
return ErrorElement(key=key)
else:
return False
return None
return element
Element = FindElement # Shortcut function
@ -4496,6 +4504,15 @@ def EncodeRadioRowCol(container, row, 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)