Global Settings
There are multiple ways to customize PySimpleGUI. Changing settings globally in your application is done through a call to set_options
. This impacts all future windows created within the calling application.
As explained in other sections, the settings/defaults work in a hierarchical fashion. The order used to search for a default is:
- Element
- Window
- Global
First the element is checked to see if a specific setting has been set. For example the scrollbar color. If no value is set, then the Window is checked to see if it has a value set as a default. If no explicit value is found, then the Global settings are used. If you've not set anything using set_options then the standard defaults provided by PySimpleGUI will be used.
For a list of all values available for you to change, see the Application-wide Configuration Settings call reference.
Global PySimpleGUI Settings Window
The global settings used by PySimpleGUI apply to all installs of PySimpleGUI on your system. If you've installed multiple versions of Python and installed PySimpleGUI for each of those interpreters, then the PySimpleGUI settings will be shared across all interpreters. If you change your default theme in the Global PySimpleGUI Settings, then it will be used for all PySimpleGUI installations on your machine.
You can access the Global PySimpleGUI Settings Window in 3 ways:
- Call
sg.main_global_pysimplegui_settings()
- Type
psgsettings
from the command line - By clicking the "Global Settings" button in the main Home Window window
The settings window has 7 tabs and a separate window for Mac-specific settings.
Theme
The Theme tab sets the theme for all of your PySimpleGUI program globally. You can set the theme as well as indicate if you want all of your windows to use a custom Titlebar.
Window Watermarking is a new feature in PySimpleGUI 5. You can create your own custom watermarks and you can also use "PySimpleGUI 5 Watermarking".
PySimpleGUI 5 Watermarking
If you frequently work with multiple versions of Python, then you know the importance of knowing exactly what you're looking at.... what version of Python, and more importantly, what version of tkinter and the PySimpleGUI version. Additionally, there is a badge that tells you if your PySimpleGUI release has passed the security audit.
Here is an enlarged view of the watermark showing, in order, the PySimpleGUI version, tkinter version, Python version, and the security badge.
Here's a simple popoup window with the watermark enabled.
In addition to controlling the watermark through the settings window, you can use 2 command line commands to turn it on (psgwatermarkon
) and off (psgwatermarkoff
) should you want to turn it on, take a screenshot, and turn it back off.
TTK
TTK styling can be control globally using this tab. You can control these same settings in your code. Making the change here will enable you to not specify each and every settings in each program. You can do it once and forget about it.
Python Interpreter
Explorer Program
Debugging Settings
This tab controls the enabling / disabling the debugger that is built into PySimpleGUI. It also controls a new to PySimpleGUI 5 feature of automatically printing the event and values variables when a window.read call is made.
Editor Settings
The editor settings is used by the error popups provided by PySimpleGUI. These popups have a "take me to the error button" that need information about your editor in order to take you to the error. This setting is also used by the Demo Browser, enabling you to easily edit any of the Demo Programs.
Window Snapshots
Window Snapshots is a little-known feature of PySimpleGUI. If you want to use this feature, you will need to install PIL.
Note that the "Auto-number Images" feature is not yet complete.
The Mac PySimpleGUI Feature Control
The Mac has been a challenging platform to support. It has experienced more platform-specific bugs than Windows and Linux. As a result of these problems, a window was created to control patches and workarounds that you may need to enable in certain situations if you're a Mac user.