From 6272927ae6d2b431418ddd7a5cde570c67a71aac Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Sat, 25 May 2019 14:34:33 -0400 Subject: [PATCH 1/2] Fix for missing return values! --- PySimpleGUIdebugger/PySimpleGUIdebugger.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PySimpleGUIdebugger/PySimpleGUIdebugger.py b/PySimpleGUIdebugger/PySimpleGUIdebugger.py index d81fb622..7811ad13 100644 --- a/PySimpleGUIdebugger/PySimpleGUIdebugger.py +++ b/PySimpleGUIdebugger/PySimpleGUIdebugger.py @@ -49,13 +49,13 @@ def non_user_init(): def _event_once(mylocals, myglobals): global myrc, watcher_window if not watcher_window: - return + return False _window = watcher_window _event, _values = _window.Read(timeout=1) if _event in (None, 'Exit'): _window.Close() watcher_window = None - return + return False cmd = _values['_INTERACTIVE_'] if _event == 'Run': _runCommand(cmd=cmd, window=_window) @@ -99,7 +99,7 @@ PySimpleGUIdebugger.PySimpleGUIdebugger.myrc = {} """.format(_values[key]) _window.Element(out_key).Update(myrc) else: _window.Element(out_key).Update('') - return + return True def _runCommand(cmd, timeout=None, window=None): @@ -121,7 +121,7 @@ def _runCommand(cmd, timeout=None, window=None): return (retval, output) def refresh(locals, globals): - _event_once(locals, globals) + return _event_once(locals, globals) def initialize(): global watcher_window From 77e0f71b10d3d7f7dcd394bcad7893e8de0ec21a Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Sat, 25 May 2019 15:36:45 -0400 Subject: [PATCH 2/2] Fix for setting look and feel to system default --- PySimpleGUI.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 26d4fa0d..0be1fd6f 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -5068,7 +5068,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): elif toplevel_form.TextJustification is not None: justification = toplevel_form.TextJustification else: - justification = DEFAULT_TEXT_JUSTIFICAION + justification = DEFAULT_TEXT_JUSTIFICATION justify = tk.LEFT if justification == 'left' else tk.CENTER if justification == 'center' else tk.RIGHT anchor = tk.NW if justification == 'left' else tk.N if justification == 'center' else tk.NE # tktext_label = tk.Label(tk_row_frame, textvariable=stringvar, width=width, height=height, @@ -5614,7 +5614,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): bd=border_depth) else: element.tktext_label = element.Widget = tk.Label(tk_row_frame, width=width, height=height, bd=border_depth) - if element.BackgroundColor is not None: + + if not element.BackgroundColor in (None, COLOR_SYSTEM_DEFAULT): element.tktext_label.config(background=element.BackgroundColor) element.tktext_label.image = photo @@ -7752,10 +7753,6 @@ def main(): [Listbox(['Listbox 1', 'Listbox 2', 'Listbox 3'], size=(20, 5))], [Combo(['Combo item 1', ], size=(20, 3), text_color='red', background_color='red')], [Combo(['Combo item 1', ], size=(20, 3), text_color='red', background_color='red')], - [Combo(['Combo item 1', ], size=(20, 3), text_color='red', background_color='red')], - [Combo(['Combo item 1', ], size=(20, 3), text_color='red', background_color='red')], - [Combo(['Combo item 1', ], size=(20, 3), text_color='red', background_color='red')], - [Combo(['Combo item 1', ], size=(20, 3), text_color='red', background_color='red')], [Spin([1, 2, 3], size=(4, 3))], ]