diff --git a/PySimpleGUI.py b/PySimpleGUI.py index bc71d6f0..e1727397 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 -version = __version__ = "4.23.0 Released 3-Jul-2020" +version = __version__ = "4.24.0 Released 3-Jul-2020" port = 'PySimpleGUI' @@ -401,6 +401,8 @@ ENABLE_TK_WINDOWS = False SUPPRESS_ERROR_POPUPS = False +ENABLE_TREEVIEW_869_PATCH = False + # ====================================================================== # # One-liner functions that are handy as f_ck # # ====================================================================== # @@ -11372,9 +11374,11 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): element.TKRightClickMenu = top_menu element.TKTreeview.bind('', element._RightClickMenuCallback) - if tclversion_detailed == '8.6.9': + if tclversion_detailed == '8.6.9' and ENABLE_TREEVIEW_869_PATCH: print('*** tk version 8.6.9 detected.... patching ttk treeview code ***') - table_style.map(style_name, foreground=_fixed_map(table_style, style_name, 'foreground'), background=_fixed_map(table_style, style_name, 'background')) + table_style.map(style_name, + foreground=_fixed_map(table_style, style_name, 'foreground'), + background=_fixed_map(table_style, style_name, 'background'),) # ------------------------- Tree placement element ------------------------- # elif element_type == ELEM_TYPE_TREE: @@ -11489,9 +11493,14 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): AddMenuItem(top_menu, menu[1], element) element.TKRightClickMenu = top_menu element.TKTreeview.bind('', element._RightClickMenuCallback) - if tclversion_detailed == '8.6.9': + if tclversion_detailed == '8.6.9' and ENABLE_TREEVIEW_869_PATCH: print('*** tk version 8.6.9 detected.... patching ttk treeview code ***') - tree_style.map(style_name, foreground=_fixed_map(tree_style, style_name, 'foreground'), background=_fixed_map(tree_style, style_name, 'background')) + tree_style.map(style_name, + foreground=_fixed_map(tree_style, style_name, 'foreground'), + background=_fixed_map(tree_style, style_name, 'background'), + ) + + # ------------------------- Separator placement element ------------------------- # elif element_type == ELEM_TYPE_SEPARATOR: @@ -12359,7 +12368,7 @@ def SetOptions(icon=None, button_color=None, element_size=(None, None), button_e text_justification=None, background_color=None, element_background_color=None, text_element_background_color=None, input_elements_background_color=None, input_text_color=None, scrollbar_color=None, text_color=None, element_text_color=None, debug_win_size=(None, None), - window_location=(None, None), error_button_color=(None, None), tooltip_time=None, tooltip_font=None, use_ttk_buttons=None, ttk_theme=None, suppress_error_popups=None): + window_location=(None, None), error_button_color=(None, None), tooltip_time=None, tooltip_font=None, use_ttk_buttons=None, ttk_theme=None, suppress_error_popups=None, enable_treeview_869_patch=None): """ :param icon: filename or base64 string to be used for the window's icon :type icon: Union[bytes, str] @@ -12476,6 +12485,7 @@ def SetOptions(icon=None, button_color=None, element_size=(None, None), button_e global USE_TTK_BUTTONS global TOOLTIP_FONT global SUPPRESS_ERROR_POPUPS + global ENABLE_TREEVIEW_869_PATCH # global _my_windows if icon: @@ -12591,6 +12601,9 @@ def SetOptions(icon=None, button_color=None, element_size=(None, None), button_e if suppress_error_popups is not None: SUPPRESS_ERROR_POPUPS = suppress_error_popups + if enable_treeview_869_patch is not None: + ENABLE_TREEVIEW_869_PATCH = enable_treeview_869_patch + return True # ----------------------------------------------------------------- # @@ -16585,7 +16598,6 @@ if __name__ == '__main__': if len(sys.argv) > 1 and sys.argv[1] == 'upgrade': _upgrade_gui() exit(0) - main() exit(0) diff --git a/docs/call reference.md b/docs/call reference.md index 3b6da570..475f1996 100644 --- a/docs/call reference.md +++ b/docs/call reference.md @@ -14495,7 +14495,8 @@ set_options(icon=None, tooltip_font=None, use_ttk_buttons=None, ttk_theme=None, - suppress_error_popups=None) + suppress_error_popups=None, + enable_treeview_869_patch=None) ``` Parameter Descriptions: @@ -14594,7 +14595,8 @@ SetOptions(icon=None, tooltip_font=None, use_ttk_buttons=None, ttk_theme=None, - suppress_error_popups=None) + suppress_error_popups=None, + enable_treeview_869_patch=None) ``` Parameter Descriptions: diff --git a/docs/index.md b/docs/index.md index 9683b958..6db88184 100644 --- a/docs/index.md +++ b/docs/index.md @@ -7314,6 +7314,14 @@ popup extensions * a few new built-in icons +## 4.24.0 PySimpleGUI 3-Jul-2020 + +Selective control over tk 8.6.9 treeview color patch + +* Disabled the code that patched the problem with background colors for Tree and Table elements +* Can enable the patched code by calling set_options + * To enable set parameter enable_treeview_869_patch = True (defaults to false) + ### Upcoming There will always be overlapping work as the ports will never actually be "complete" as there's always something new that can be built. However there's a definition for the base functionality for PySimpleGUI. This is what is being strived for with the current ports that are underway. diff --git a/readme.md b/readme.md index 9683b958..6db88184 100644 --- a/readme.md +++ b/readme.md @@ -7314,6 +7314,14 @@ popup extensions * a few new built-in icons +## 4.24.0 PySimpleGUI 3-Jul-2020 + +Selective control over tk 8.6.9 treeview color patch + +* Disabled the code that patched the problem with background colors for Tree and Table elements +* Can enable the patched code by calling set_options + * To enable set parameter enable_treeview_869_patch = True (defaults to false) + ### Upcoming There will always be overlapping work as the ports will never actually be "complete" as there's always something new that can be built. However there's a definition for the base functionality for PySimpleGUI. This is what is being strived for with the current ports that are underway.