Merge pull request #1434 from PySimpleGUI/Dev-latest
New function - ClosePySimpleGUI() - deletes the hidden master window
This commit is contained in:
commit
f95eca095e
|
@ -62,6 +62,14 @@ def TimerStop():
|
||||||
PEP8 - this code is far far from PEP8 compliant.
|
PEP8 - this code is far far from PEP8 compliant.
|
||||||
It was written PRIOR to learning that PEP8 existed.
|
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
|
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
|
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
|
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))
|
'window.FindElement("{}")'.format(key))
|
||||||
return ErrorElement(key=key)
|
return ErrorElement(key=key)
|
||||||
else:
|
else:
|
||||||
return False
|
return None
|
||||||
return element
|
return element
|
||||||
|
|
||||||
Element = FindElement # Shortcut function
|
Element = FindElement # Shortcut function
|
||||||
|
@ -4496,6 +4504,15 @@ def EncodeRadioRowCol(container, row, col):
|
||||||
return RadValue
|
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 ------- #
|
# ------- FUNCTION BuildResults. Form exiting so build the results to pass back ------- #
|
||||||
# format of return values is
|
# format of return values is
|
||||||
# (Button Pressed, input_values)
|
# (Button Pressed, input_values)
|
||||||
|
|
Loading…
Reference in New Issue