Sets / Gets the global PySimpleGUI Theme. If none is specified then returns the global theme from user settings. Note the theme must be a standard, built-in PySimpleGUI theme... not a user-created theme. :param new_theme: the new theme name to use :type new_theme: (str) :retu
(new_theme=None)
| 19907 | |
| 19908 | |
| 19909 | def theme_global(new_theme=None): |
| 19910 | """ |
| 19911 | Sets / Gets the global PySimpleGUI Theme. If none is specified then returns the global theme from user settings. |
| 19912 | Note the theme must be a standard, built-in PySimpleGUI theme... not a user-created theme. |
| 19913 | |
| 19914 | :param new_theme: the new theme name to use |
| 19915 | :type new_theme: (str) |
| 19916 | :return: the currently selected theme |
| 19917 | :rtype: (str) |
| 19918 | """ |
| 19919 | if new_theme is not None: |
| 19920 | if new_theme not in theme_list(): |
| 19921 | popup_error_with_traceback('Cannot use custom themes with theme_global call', |
| 19922 | 'Your request to use theme {} cannot be performed.'.format(new_theme), |
| 19923 | 'The PySimpleGUI Global User Settings are meant for PySimpleGUI standard items, not user config items', |
| 19924 | 'You can use any of the many built-in themes instead or use your own UserSettings file to store your custom theme') |
| 19925 | return pysimplegui_user_settings.get('-theme-', CURRENT_LOOK_AND_FEEL) |
| 19926 | pysimplegui_user_settings.set('-theme-', new_theme) |
| 19927 | theme(new_theme) |
| 19928 | return new_theme |
| 19929 | else: |
| 19930 | return pysimplegui_user_settings.get('-theme-', CURRENT_LOOK_AND_FEEL) |
| 19931 | |
| 19932 | |
| 19933 | def theme_previewer(columns=12, scrollable=False, scroll_area_size=(None, None), search_string=None, location=(None, None)): |
no test coverage detected