From 436f9c35d9bb24d80b1dcbbdebbc0d11abdadaf9 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Thu, 6 Sep 2018 21:56:20 -0400 Subject: [PATCH] Had to turn off grab_anywhere... causes problems when you have sliders! Drat! --- PySimpleGUI.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index de9e43f2..18db4c0e 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1422,7 +1422,7 @@ class FlexForm: ''' Display a user defined for and return the filled in data ''' - def __init__(self, title, default_element_size=DEFAULT_ELEMENT_SIZE, default_button_element_size = (None, None), auto_size_text=None, auto_size_buttons=None, scale=(None, None), location=(None, None), button_color=None, font=None, progress_bar_color=(None, None), background_color=None, is_tabbed_form=False, border_depth=None, auto_close=False, auto_close_duration=DEFAULT_AUTOCLOSE_TIME, icon=DEFAULT_WINDOW_ICON, return_keyboard_events=False, use_default_focus=True, text_justification=None, no_titlebar=False, grab_anywhere=True): + def __init__(self, title, default_element_size=DEFAULT_ELEMENT_SIZE, default_button_element_size = (None, None), auto_size_text=None, auto_size_buttons=None, scale=(None, None), location=(None, None), button_color=None, font=None, progress_bar_color=(None, None), background_color=None, is_tabbed_form=False, border_depth=None, auto_close=False, auto_close_duration=DEFAULT_AUTOCLOSE_TIME, icon=DEFAULT_WINDOW_ICON, return_keyboard_events=False, use_default_focus=True, text_justification=None, no_titlebar=False, grab_anywhere=False): self.AutoSizeText = auto_size_text if auto_size_text is not None else DEFAULT_AUTOSIZE_TEXT self.AutoSizeButtons = auto_size_buttons if auto_size_buttons is not None else DEFAULT_AUTOSIZE_BUTTONS self.Title = title @@ -1638,12 +1638,16 @@ class FlexForm: def StartMove(self, event): - self.TKroot.x = event.x - self.TKroot.y = event.y + try: + self.TKroot.x = event.x + self.TKroot.y = event.y + except: pass def StopMove(self, event): - self.TKroot.x = None - self.TKroot.y = None + try: + self.TKroot.x = None + self.TKroot.y = None + except: pass def OnMotion(self, event): try: