From e6f8dd05b519ebed47fd5dfde19d300b79ab9d9e Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Sun, 9 Dec 2018 13:39:27 -0500 Subject: [PATCH] Get method for Spin --- PySimpleGUI.py | 5 +++-- PySimpleGUIQt/PySimpleGUIQt.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 18ccba0c..e0eb6be8 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -962,6 +962,9 @@ class Spin(Element): if self.ParentForm.CurrentlyRunningMainloop: self.ParentForm.TKroot.quit() # kick the users out of the mainloop + def Get(self): + return self.TKStringVar.get() + def __del__(self): try: self.TKSpinBox.__del__() @@ -5226,13 +5229,11 @@ def StartupTK(my_flex_form): # ow = _my_windows.NumOpenWindows ow = Window.NumOpenWindows - print(ow) # print('Starting TK open Windows = {}'.format(ow)) if not ow and not my_flex_form.ForceTopLevel: # if first window being created, make a throwaway, hidden master root. This stops one user # window from becoming the child of another user window. All windows are children of this # hidden window - print("******") Window.IncrementOpenCount() Window.hidden_master_root = tk.Tk() Window.hidden_master_root.attributes('-alpha', 0) # HIDE this window really really really diff --git a/PySimpleGUIQt/PySimpleGUIQt.py b/PySimpleGUIQt/PySimpleGUIQt.py index 424b0e8c..86025b87 100644 --- a/PySimpleGUIQt/PySimpleGUIQt.py +++ b/PySimpleGUIQt/PySimpleGUIQt.py @@ -965,6 +965,8 @@ class Spin(Element): self.QT_Spinner.setDisabled(False) super().Update(self.QT_Spinner, background_color=background_color, text_color=text_color, font=font, visible=visible) + def Get(self): + return self.QT_Spinner.value() def __del__(self): super().__del__()