From ca93e48ad46292b081b148e1915d0b7b7a377927 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Tue, 26 Jul 2022 08:45:57 -0400 Subject: [PATCH 1/5] 4.60.1 patch that was released 22-May-2022 --- PySimpleGUI.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index c89076cf..deb8f254 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1,10 +1,13 @@ #!/usr/bin/python3 -version = __version__ = "4.60.0 Released 8-May-2022" +version = __version__ = "4.60.1 Released 22-May-2022" _change_log = """ Changelog since 4.60.0 released to PyPI on 8-May-2022 + 4.60.1 + A "dot-release" / patch for crash that occurs if the horizontal_scroll parm is set in Listbox element + Was created when the ttk scrollbars were added """ __version__ = version.split()[0] # For PEP 396 and PEP 345 @@ -15543,7 +15546,6 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): # Horizontal scrollbar if element.HorizontalScroll: - element.TKText.config(wrap='none') _make_ttk_scrollbar(element, 'h', toplevel_form) element.hsb.pack(side=tk.BOTTOM, fill='x') element.Widget.configure(xscrollcommand=element.hsb.set) From 45de5867fbf59ccfb01c06d90009fb225f9e13a9 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Tue, 26 Jul 2022 10:44:00 -0400 Subject: [PATCH 2/5] 4.60.2 Candidate Release --- PySimpleGUI.py | 48 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index deb8f254..51b05ed9 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1,13 +1,15 @@ #!/usr/bin/python3 -version = __version__ = "4.60.1 Released 22-May-2022" +version = __version__ = "4.60.2 Released 26-Jul-2022" _change_log = """ - Changelog since 4.60.0 released to PyPI on 8-May-2022 + Changelog since 4.60.0 released to PyPI on 8-May-2022. These are "Dot" releases.... 4.60.1 A "dot-release" / patch for crash that occurs if the horizontal_scroll parm is set in Listbox element Was created when the ttk scrollbars were added + 4.60.2 + A "dot-release" for Mac 12.3+ "Invisible window" problem. Adds option in Mac control panel to set Alpha to 0.99 as default """ __version__ = version.split()[0] # For PEP 396 and PEP 345 @@ -422,6 +424,7 @@ DEFAULT_TOOLTIP_TIME = 400 DEFAULT_TOOLTIP_OFFSET = (0, -20) DEFAULT_KEEP_ON_TOP = None DEFAULT_SCALING = None +DEFAULT_ALPHA_CHANNEL = 1.0 TOOLTIP_BACKGROUND_COLOR = "#ffffe0" TOOLTIP_FONT = None #################### COLOR STUFF #################### @@ -615,6 +618,7 @@ ENABLE_TREEVIEW_869_PATCH = True ENABLE_MAC_NOTITLEBAR_PATCH = False ENABLE_MAC_MODAL_DISABLE_PATCH = False ENABLE_MAC_DISABLE_GRAB_ANYWHERE_WITH_TITLEBAR = True +ENABLE_MAC_ALPHA_99_PATCH= False OLD_TABLE_TREE_SELECTED_ROW_COLORS = ('#FFFFFF', '#4A6984') ALTERNATE_TABLE_AND_TREE_SELECTED_ROW_COLORS = ('SystemHighlightText', 'SystemHighlight') @@ -9328,7 +9332,7 @@ class Window: element_padding=None, margins=(None, None), button_color=None, font=None, progress_bar_color=(None, None), background_color=None, border_depth=None, auto_close=False, auto_close_duration=DEFAULT_AUTOCLOSE_TIME, icon=None, force_toplevel=False, - alpha_channel=1, return_keyboard_events=False, use_default_focus=True, text_justification=None, + alpha_channel=None, return_keyboard_events=False, use_default_focus=True, text_justification=None, no_titlebar=False, grab_anywhere=False, grab_anywhere_using_control=True, keep_on_top=None, resizable=False, disable_close=False, disable_minimize=False, right_click_menu=None, transparent_color=None, debugger_enabled=True, right_click_menu_background_color=None, right_click_menu_text_color=None, right_click_menu_disabled_text_color=None, @@ -9518,7 +9522,7 @@ class Window: self.KeepOnTop = keep_on_top self.ForceTopLevel = force_toplevel self.Resizable = resizable - self._AlphaChannel = alpha_channel + self._AlphaChannel = alpha_channel if alpha_channel is not None else DEFAULT_ALPHA_CHANNEL self.Timeout = None self.TimeoutKey = TIMEOUT_KEY self.TimerCancelled = False @@ -17740,7 +17744,7 @@ def set_options(icon=None, button_color=None, element_size=(None, None), button_ suppress_error_popups=None, suppress_raise_key_errors=None, suppress_key_guessing=None,warn_button_key_duplicates=False, enable_treeview_869_patch=None, enable_mac_notitlebar_patch=None, use_custom_titlebar=None, titlebar_background_color=None, titlebar_text_color=None, titlebar_font=None, titlebar_icon=None, user_settings_path=None, pysimplegui_settings_path=None, pysimplegui_settings_filename=None, keep_on_top=None, dpi_awareness=None, scaling=None, disable_modal_windows=None, force_modal_windows=None, tooltip_offset=(None, None), - sbar_trough_color=None, sbar_background_color=None, sbar_arrow_color=None, sbar_width=None, sbar_arrow_width=None, sbar_frame_color=None, sbar_relief=None): + sbar_trough_color=None, sbar_background_color=None, sbar_arrow_color=None, sbar_width=None, sbar_arrow_width=None, sbar_frame_color=None, sbar_relief=None, alpha_channel=None): """ :param icon: Can be either a filename or Base64 value. For Windows if filename, it MUST be ICO format. For Linux, must NOT be ICO. Most portable is to use a Base64 of a PNG file. This works universally across all OS's :type icon: bytes | str @@ -17867,6 +17871,8 @@ def set_options(icon=None, button_color=None, element_size=(None, None), button_ :param sbar_frame_color: Scrollbar Color of frame around scrollbar (available only on some ttk themes) :type sbar_frame_color: (str) :param sbar_relief: Scrollbar relief that will be used for the "thumb" of the scrollbar (the thing you grab that slides). Should be a constant that is defined at starting with "RELIEF_" - RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID + :param alpha_channel Default alpha channel to be used on all windows + :type alpha_channel (float) :type sbar_relief: (str) :return: None :rtype: None @@ -17926,6 +17932,8 @@ def set_options(icon=None, button_color=None, element_size=(None, None), button_ global DEFAULT_MODAL_WINDOWS_ENABLED global DEFAULT_MODAL_WINDOWS_FORCED global DEFAULT_TOOLTIP_OFFSET + global DEFAULT_ALPHA_CHANNEL + global _pysimplegui_user_settings global ttk_part_overrides_from_options # global _my_windows @@ -18111,6 +18119,8 @@ def set_options(icon=None, button_color=None, element_size=(None, None), button_ if tooltip_offset != (None, None): DEFAULT_TOOLTIP_OFFSET = tooltip_offset + if alpha_channel is not None: + DEFAULT_ALPHA_CHANNEL = alpha_channel # ---------------- ttk scrollbar section ---------------- if sbar_background_color is not None: @@ -22256,7 +22266,8 @@ available to make this process more atuomatic. # Dictionary of Mac Patches. Used to find the key in the global settings and the default value MAC_PATCH_DICT = {'Enable No Titlebar Patch' : ('-mac feature enable no titlebar patch-', False), 'Disable Modal Windows' : ('-mac feature disable modal windows-', True), - 'Disable Grab Anywhere with Titlebar' : ('-mac feature disable grab anywhere with titlebar-', True)} + 'Disable Grab Anywhere with Titlebar' : ('-mac feature disable grab anywhere with titlebar-', True), + 'Set Alpha Channel to 0.99 for MacOS >= 12.3' : ('-mac feature disable Alpha 0.99', True)} def _read_mac_global_settings(): """ @@ -22267,6 +22278,7 @@ def _read_mac_global_settings(): global ENABLE_MAC_MODAL_DISABLE_PATCH global ENABLE_MAC_NOTITLEBAR_PATCH global ENABLE_MAC_DISABLE_GRAB_ANYWHERE_WITH_TITLEBAR + global ENABLE_MAC_ALPHA_99_PATCH ENABLE_MAC_MODAL_DISABLE_PATCH = pysimplegui_user_settings.get(MAC_PATCH_DICT['Disable Modal Windows'][0], MAC_PATCH_DICT['Disable Modal Windows'][1]) @@ -22274,7 +22286,8 @@ def _read_mac_global_settings(): MAC_PATCH_DICT['Enable No Titlebar Patch'][1]) ENABLE_MAC_DISABLE_GRAB_ANYWHERE_WITH_TITLEBAR = pysimplegui_user_settings.get(MAC_PATCH_DICT['Disable Grab Anywhere with Titlebar'][0], MAC_PATCH_DICT['Disable Grab Anywhere with Titlebar'][1]) - + ENABLE_MAC_ALPHA_99_PATCH = pysimplegui_user_settings.get(MAC_PATCH_DICT['Set Alpha Channel to 0.99 for MacOS >= 12.3'][0], + MAC_PATCH_DICT['Set Alpha Channel to 0.99 for MacOS >= 12.3'][1]) def _mac_should_apply_notitlebar_patch(): """ @@ -22297,6 +22310,23 @@ def _mac_should_apply_notitlebar_patch(): return False +def _mac_should_set_alpha_to_99(): + + if not running_mac(): + return False + + if not ENABLE_MAC_ALPHA_99_PATCH: + return False + + try: + if (float(platform.mac_ver()[0]) >= 12.3): + return True + except Exception as e: + warnings.warn('_mac_should_seet_alpha_to_99 Exception while trying check mac_ver. Error = {}'.format(e), UserWarning) + return False + + return False + def main_mac_feature_control(): """ @@ -24815,6 +24845,10 @@ if running_windows(): _read_mac_global_settings() + +if _mac_should_set_alpha_to_99(): + print('Applyting Mac OS 12.3+ Alpha Channel fix. Your default Alpha Channel is now 0.99') + set_options(alpha_channel=0.99) # if running_mac(): # print('Your Mac patches are:') # print('Modal windows disabled:', ENABLE_MAC_MODAL_DISABLE_PATCH) From 8e9b532657b8f8ef0ce296a2810d3bebe5d159f2 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Wed, 27 Jul 2022 08:34:19 -0400 Subject: [PATCH 3/5] 4.60.3 - Another shot at the Mac OS 12.3+ problem - fixed the version checking --- PySimpleGUI.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 51b05ed9..45fcaac9 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 -version = __version__ = "4.60.2 Released 26-Jul-2022" +version = __version__ = "4.60.3 Released 27-Jul-2022" _change_log = """ Changelog since 4.60.0 released to PyPI on 8-May-2022. These are "Dot" releases.... @@ -10,6 +10,8 @@ _change_log = """ Was created when the ttk scrollbars were added 4.60.2 A "dot-release" for Mac 12.3+ "Invisible window" problem. Adds option in Mac control panel to set Alpha to 0.99 as default + 4.60.3 + Another shot at the 12.3+ Mac OS problem. Had bug in the version check code """ __version__ = version.split()[0] # For PEP 396 and PEP 345 @@ -141,7 +143,6 @@ from uuid import uuid4 # get the tkinter detailed version tclversion_detailed = tkinter.Tcl().eval('info patchlevel') framework_version = tclversion_detailed - import time import pickle import calendar @@ -22318,8 +22319,13 @@ def _mac_should_set_alpha_to_99(): if not ENABLE_MAC_ALPHA_99_PATCH: return False + # At this point, we're running a Mac and the alpha patch is enabled + # Final check is to see if Mac OS version is 12.3 or later try: - if (float(platform.mac_ver()[0]) >= 12.3): + platform_mac_ver = platform.mac_ver()[0] + mac_ver = platform_mac_ver.split('.') + if int(mac_ver[0]) >= 12 and int(mac_ver[0]) >= 3: + print("Mac OS Version is {} and patch enabled so applying the patch".format(platform_mac_ver)) return True except Exception as e: warnings.warn('_mac_should_seet_alpha_to_99 Exception while trying check mac_ver. Error = {}'.format(e), UserWarning) From 63f73c222b4e78a9a7921a6e0ae5b2ad3add91ba Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Wed, 27 Jul 2022 11:16:48 -0400 Subject: [PATCH 4/5] Trying 4.60.3 AGAIN... this time checking the mac_ver[1] and also checking for releases 13+ --- PySimpleGUI.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 45fcaac9..0edf9a0c 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -22324,7 +22324,7 @@ def _mac_should_set_alpha_to_99(): try: platform_mac_ver = platform.mac_ver()[0] mac_ver = platform_mac_ver.split('.') - if int(mac_ver[0]) >= 12 and int(mac_ver[0]) >= 3: + if (int(mac_ver[0]) >= 12 and int(mac_ver[1]) >= 3) or int(mac_ver[0]) >= 13 : print("Mac OS Version is {} and patch enabled so applying the patch".format(platform_mac_ver)) return True except Exception as e: From b037e1426bb80e6d91b740634e9032b1f92eb939 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Wed, 27 Jul 2022 17:31:19 -0400 Subject: [PATCH 5/5] Final 4.60.3 released to PyPI --- PySimpleGUI.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 0edf9a0c..2c92ac1b 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -22323,7 +22323,7 @@ def _mac_should_set_alpha_to_99(): # Final check is to see if Mac OS version is 12.3 or later try: platform_mac_ver = platform.mac_ver()[0] - mac_ver = platform_mac_ver.split('.') + mac_ver = platform_mac_ver.split('.') if '.' in platform_mac_ver else (platform_mac_ver, 0) if (int(mac_ver[0]) >= 12 and int(mac_ver[1]) >= 3) or int(mac_ver[0]) >= 13 : print("Mac OS Version is {} and patch enabled so applying the patch".format(platform_mac_ver)) return True