FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Added kwargs to set_options. Used to soak up options that are not rec… · PySimpleGUI/PySimpleGUI@98fa545 · GitHub

Commit 98fa545

Browse files
committed
Added kwargs to set_options. Used to soak up options that are not recognized. This keeps bad options from crashing the program. It won't help the older versions of PySimpleGUI that don't recognize a new option, but it will help from this version of PySimpleGUI onward
1 parent 478412b commit 98fa545

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎PySimpleGUI/PySimpleGUI.py‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
"""
5656

57-
version = "6.3.7"
57+
version = "6.3.8"
5858

5959

6060

@@ -77,6 +77,8 @@
7777
that indicates the directions the window can be resized (e.g. resizable=(False, True) means only allow resizing in the Y direction.
7878
6.3.6 15-Aug-2026 Changed _error_popup_with_code to add the text at the top of the error window into the Multiline so that a user can copy the entire error using the Multiline
7979
6.3.7 18-Aug-2026 New debugging aid - "set tooltip to element's key" is enabled by calling set_options(set_tooltip_to_element_key=True)
80+
6.3.8 21-Aug-2026 Added kwargs to set_options. Used to soak up options that are not recognized. This keeps bad options from crashing the program. It won't help the
81+
older versions of PySimpleGUI that don't recognize a new option, but it will help from this version of PySimpleGUI onward
8082
"""
8183

8284

@@ -19274,7 +19276,7 @@ def set_options(icon=None, button_color=None, element_size=(None, None), button_
1927419276
enable_mac_notitlebar_patch=None, use_custom_titlebar=None, titlebar_background_color=None, titlebar_text_color=None, titlebar_font=None,
1927519277
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),
1927619278
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,
19277-
hide_window_when_creating=None, use_button_shortcuts=None, watermark_text=None, win_app_id=None, set_tooltip_to_element_key=None):
19279+
hide_window_when_creating=None, use_button_shortcuts=None, watermark_text=None, win_app_id=None, set_tooltip_to_element_key=None, **kwargs):
1927819280
"""
1927919281
: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
1928019282
:type icon: bytes | str
@@ -19412,8 +19414,8 @@ def set_options(icon=None, button_color=None, element_size=(None, None), button_
1941219414
:type watermark_text: (str)
1941319415
:param win_app_id: For Windows only. Sets string that's passed to Windows to control combining icons on taskbar. Default is " mycompany.myproduct.subproduct.version". Windows with same ID combine on taskbar. Change before creating a window to set that window's ID.
1941419416
:type win_app_id: (str)
19415-
:return: None
19416-
:rtype: None
19417+
:param **kwargs: The keyword args
19418+
:type **kwargs: (Any)
1941719419
"""
1941819420

1941919421
global DEFAULT_ELEMENT_SIZE
@@ -19704,8 +19706,8 @@ def set_options(icon=None, button_color=None, element_size=(None, None), button_
1970419706
except Exception as e:
1970519707
print('Error setting App ID', e)
1970619708

19707-
return True
19708-
19709+
if len(kwargs) != 0:
19710+
print('set_options - bad parameter set', 'The parameter(s) used in set_options were not recognized options:\n', *[f' {key}={value}\n' for key, value in kwargs.items()])
1970919711
# ----------------------------------------------------------------- #
1971019712

1971119713
# .########.##.....##.########.##.....##.########..######.

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def readme():
1111

1212
setuptools.setup(
1313
name="pysimplegui",
14-
version="6.3.7",
14+
version="6.3.8",
1515
author="PySimpleGUI",
1616
author_email="PySimpleGUI@PySimpleGUI.org",
1717
description="Python GUIs for Humans. Launched in 2018. NEW LGPL3 Version 6 released in 2026.",

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL