New Form Function - CloseNonBlockingForm, fix for context managers

Previously an exception within the "with" block was not correctly passing along exceptions.

New function to help with non-blocking forms.  For forms that need to be closed that haven't been closed by a button, a new function was needed.  CloseNonBlockingForm is the new function.
This commit is contained in:
MikeTheWatchGuy 2018-07-17 13:43:58 -04:00
parent e2ee6bd9af
commit 951f3f1a6d
1 changed files with 5 additions and 1 deletions

View File

@ -686,6 +686,10 @@ class FlexForm:
self.RootNeedsDestroying = True
return results
def CloseNonBlockingForm(self):
self.TKroot.destroy()
_my_windows.NumOpenWindows -= 1 * (_my_windows.NumOpenWindows != 0) # decrement if not 0
def OnClosingCallback(self):
return
@ -694,7 +698,7 @@ class FlexForm:
def __exit__(self, *a):
self.__del__()
return self
return False
def __del__(self):
for row in self.Rows: