Release 4.60.0

This commit is contained in:
PySimpleGUI 2022-05-08 12:50:09 -04:00
parent 577af38445
commit 66931d51e1
7 changed files with 376 additions and 147 deletions

View File

@ -1,154 +1,10 @@
#!/usr/bin/python3 #!/usr/bin/python3
version = __version__ = "4.59.0.45 Released 5-Apr-2022" version = __version__ = "4.60.0 Released 8-May-2022"
_change_log = """ _change_log = """
Changelog since 4.59.0 released to PyPI on 5-Apr-2022 Changelog since 4.60.0 released to PyPI on 8-May-2022
4.59.0.1
Addition of the blocking parameter to the Print function. Enables using Print through an entire program with the last
Print call setting the blocking parameter so that the window doesn't close until user interacts with the Debug Output Window
4.59.0.2
Added SUPPRESS_WIDGET_NOT_FINALIZED_WARNINGS as a way to turn off checking for widgets to be finalized. Needed to get around some race conditions.
It's possible (likely) that a debug window is closed while printing to the debug window. This would normally generate an error. Use this flag to
turn off this error checking temporarily
4.59.0.3
NEW ttk scrollbars added to Multiline, Listbox, Table and Tree
Tree element - added new horizontal scrollbar (also uses the new ttk scrollbar)
Parameters added to Mulitline, Listbox, Table and Tree to control the scrollbar styling
NOTE - the positioning methods have not been tested for the new ttk scrollbars. They are being releaseed just to get some feedback on the look of these scrollbars
4.59.0.4
New Window screencapture that uses PIL if you've got PIL installed.
It does NOT require PIL be installed in order to use PySimpleGUI. ONLY when a capture is attempted does PySimpleGUI try to import PIL
It's the first step of building the larger "Catalog" feature
The alignment is not perfect and the whole thing needs more work
The keystrokes used to perform the cpature, the locatoin the file is stored and the filename are al in the PySimpleGUI global settings
The auto-numbering freature is not yet implemented. Only 1 file is used and is overwritten if exists
4.59.0.5
Fixed the font and sizing of the "Editor Settings" section
Niocer abnner at the top of the window
4.59.0.6
Added exception handing to the bind methods
4.59.0.7
More exception handling
4.59.0.8
New Debug Print capability - The "Pause/Resume" option enables printing to be paused. This will block the caller
Added ability to control use of Custom Titlebar from the system settings. Turn on Customer Titlebar setting in the
Global System Settings and that will cause all windows to automatically use a custom titlebar and custom menubar
New theme call to determine if a custom titlebar shoue be used - theme_use_custom_titlebar returns True if should use one
Main test harness
Fixed freeing up the graphic lines being drawn as they scrolled off the screen. Now as each lines if scrolled off the screen, tit is feed up
Window is not modal so can interact the debug Print window
Grab anywhere turned off - Remember can always use CONTROL + LEFT CLICK & DRAG to move ANY PySimpleGUI as if grab anywhere is enabled
4.59.0.9
Made the save window as image into a Window method - Window.save_window_screenshot_to_disk
Show a popup message when a window save is performed using the keys specified in the system settings
Debug Print still has some problems so be warned for the time being... it's being worked on...
4.59.0.10
Ugh .... terrible ttk theme bug! Sorry!!!
4.59.0.11
Improved TTK theme error reporting
4.59.0.12
user_settings_delete_filename - added report_error parm giving ability to turn off the error popup (now off by default). The UserSettings object also got this parm
Big rework is in progress for the global settings. Converted to entirely use TABS now. It's getting closer!!! Can almost taste the new tastey ttk scrollbars
4.59.0.13
theme_global - added error checking and reporting about non-standard theme names being attempted
Dark Grey 15 - NEW theme! (inspired by the theme_global issue :-)
4.59.0.14
Made default TTK scrollbar width 12 pixels instead of 10. They're still smaller than the old tk scrollbars that are about 17 pixels wide
Removed the "Thumb Color" and "Thumb Depressed" ttk slider parms... it's not a settable option generally speaking so it had to go.
Two new theme calls - theme_button_color_background and theme_button_color_text. They are read-only calls and are simply the button color (theme_button_color) TUPLE split apart
Completed the first draft of the TTK Scrollbar settings in the Global settings window... was a LOT more work than I estimated!
4.59.0.15
TTK Theme added to the System Settings :-)
Made the ttk scrollbar settings tab look nicer
4.59.0.16
Added button to test ttk scrollbar settings within the System Settings window. Aids in changing the design if scrollbar colors, sizes, etc.
4.59.0.17
Noted tricky problem - if "always use custom titlebar" is set in system settings, then USER still needs to account for this in their layout
That means using the MenubarCustom instaed of Menu. For now, user will have to handle this. Will come back to it to fix up later
Made MenubarCustom have a pad=0 by default so that it's snug under the titlebar and extends to edges correctly.
Renamed ttk scrollbar system settings tab to ttk
4.59.0.18
Got the Debug Print stuff working right! YES!
Added new parm "wait" which is an alias for the "blocking" parm. Some may like it better. Take your choice
Changed button text to "Click to continue" if the blocking/wait parm is set so that it's obvious that your program is waiting on you
4.59.0.19
OK... this time got the Debug Print stuff working right for real! YES? ;-)
4.59.0.20
irony - when you accidently leave debug prints in your debug print code
4.59.0.21
Additional exception handling needed for debug window closure at any point
4.59.0.22
"Ding-dong the Output's dead" - finally replaced the Output element with Multiline by subclassing Multiline
This solves a bunch of problems including duplication of funcationality using 2 different techniques.
Problem may be in backward compatibility if anyone is using internal Output element member variables, etc.
4.59.0.23
Changed the popup errors for Tabs to be popup error with traceback. Much nicer experience with this newer error popup
Removed Output Element from the packer function... you know it's really gone when it's not in there
To be clear, there still is an Output Element... it's just a Multiline in disguise now.
4.59.0.24
Support for the GrayGrayGray theme with the new ttk scrollbars... for those that like the grayscale world, you're now safe
4.59.0.25
Fix for systems that don't yet have the ttk scrollbars set up. Was getting the incorrect defaults (they were all blank)
4.59.0.26
Debug window - betting re-opening code so that the data is not missed from being printed
4.59.0.27
ttk scrollbar support for Column element - was really hacked in to get things to work. Next step is a little cleanup but want to
first simply make sure it's working. Changes were limited to the scrollable column class (which was the scene of the hack-crime too)
4.59.0.28
fixed the Column.update call! Missed the renaming of the ExpandX to expand_x in that function. Sorry if you hit it!
4.59.0.29
Added parms and docstrings to all elements with ttk scrollbars
Needed to remove the "arrow background color" option for ttk scrollbars. You can't set that color directly it turns out... so one less parm now
4.59.0.30
Get ttk themes available from ttk rather than the hard coded list. This is used in the Global Settings window.
4.59.0.31
Fixed default ttk theme bug - was being changed when a window set a theme just for 1 window. The overall default shouldn't change for this situation
Added support for the heirarchical specification of ttk scrollbars. The settings will be picked up in this order:
Element, Window, Set Options, Global Settings
4.59.0.32
Add the ttk theme list AFTER the global options window is created. This "fix" is only needed when a user calls the global options window directly.
If don't do this, the tkinter will create a weird temp window if you call to get the list of ttk themes (gee.... thanks ttk!)
An alternate method would be to do the same thing as measuring the screensize where the hidden master window is created to pull it off.
Since this is the only place the theme list is retrieved, for now will do the update of the list after the window is created. This features is
already taking forever... (insert eyeroll emoji here)
Removed "Use TTK Scrollbars" checkbox in global settings... you're getting TTK scrollbars whether you like it or not ;-)
Prettied up the ttk settings tab in global settings
4.59.0.33
New Column element parameters - size_subsample_width & size_subsample_height
Gives much more control over the sizing of SCROLLABLE columns. Previously the size was set to 1/2 the required height and the full required width.
The defaults are backward compatible (size_subsample_width=1, size_subsample_height=2)
Setting both to 1 will make the Column fit the contents exactly.
One use is when you expect your Column to grow or shrink over time. Or maybe you didn't like the 1/2 size that PySimpleGUI has always used before.
Hoping this isn't too complex to understand!
4.59.0.34
Fix crash in Element.bind... likely created in version 4.59.0.6.
Crashes because Elements don't have the method _is_window_created which was being called. YIKES!
4.59.0.35
New coupon
4.59.0.36
Made selected text color for Input, Combo and Multiline match the color theme! (THANK YOU JASON!)
4.59.0.37
Added back the filetypes parameter availability for the mac for the file browse operations. Was previously (incorrectly evidently!) removed for FileBrowse operations
(Thank you resnbl for all the help!)
4.59.0.38
Combo element finally gets drop-down list formatting (thank you Jason!)
4.59.0.39
Reworked sg.main test harness to recover space to fit on smaller screens
Make upgrade from github Multiline smaller to fit the Pi screen
4.59.0.40
Auto-correct file_types problems for Browse buttons. Automatically change the formatting from (str, str) to ((str, str),) and warn the user
4.59.0.41
Docstring typo fixes for file_types parm
4.59.0.42
FileBrowse - giving a series of try blocks a try to see if can get around the Mac file_types issue
4.59.0.43
Hi-Ho-Hi-Ho... it's back to no file_type on the Mac we go... Need to add similar code to popup_get_file to ensure doesn't crash there too.
4.59.0.44
Fix in popup_get_file for the file_type parameter that crashes on the Mac. Like the Browse button, the file_type parameter is disabled for the Mac. VERY sorry Mac users
4.59.0.45
Fix for Scrollable Columns that expand. Needed to switch to using the canvas, not the frame, for scrolling (THANK YOU Jason and milahu!)
""" """
__version__ = version.split()[0] # For PEP 396 and PEP 345 __version__ = version.split()[0] # For PEP 396 and PEP 345
@ -18961,6 +18817,14 @@ def theme_add_new(new_theme_name, new_theme_dict):
def theme_use_custom_titlebar(): def theme_use_custom_titlebar():
"""
Returns True if a custom titlebar will be / should be used.
The setting is in the Global Settings window and can be overwridden
using set_options call
:return: True if a custom titlebar / custom menubar should be used
:rtype: (bool)
"""
if USE_CUSTOM_TITLEBAR is False: if USE_CUSTOM_TITLEBAR is False:
return False return False

View File

@ -13632,6 +13632,20 @@ Parameter Descriptions:
|--|--|--| |--|--|--|
| str | filename | Filename to save the values to in pickled form | | str | filename | Filename to save the values to in pickled form |
### save_window_screenshot_to_disk
Saves an image of the PySimpleGUI window provided into the filename provided
```
save_window_screenshot_to_disk(filename = None)
```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| (PIL.ImageGrab or None) | **RETURN** | A PIL ImageGrab object that can be saved or manipulated
### send_to_back ### send_to_back
Pushes this window to the bottom of the stack of windows. It is the opposite of BringToFront Pushes this window to the bottom of the stack of windows. It is the opposite of BringToFront
@ -18689,6 +18703,32 @@ Parameter Descriptions:
|--|--|--| |--|--|--|
| (str, str) | **RETURN** | (str, str) - TUPLE with color strings of the button color currently in use (button text color, button background color) | (str, str) | **RETURN** | (str, str) - TUPLE with color strings of the button color currently in use (button text color, button background color)
Returns the button color background currently in use. Note this function simple calls the theme_button_color
function and splits apart the tuple
```
theme_button_color_background()
```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| (str) | **RETURN** | color string of the button color background currently in use
Returns the button color text currently in use. Note this function simple calls the theme_button_color
function and splits apart the tuple
```
theme_button_color_text()
```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| (str) | **RETURN** | color string of the button color text currently in use
Sets/Returns the background color currently in use for all elements except containers Sets/Returns the background color currently in use for all elements except containers
``` ```
@ -18864,6 +18904,20 @@ Parameter Descriptions:
|--|--|--| |--|--|--|
| (str) | **RETURN** | (str) - color string of the text background color currently in use | (str) | **RETURN** | (str) - color string of the text background color currently in use
Returns True if a custom titlebar will be / should be used.
The setting is in the Global Settings window and can be overwridden
using set_options call
```
theme_use_custom_titlebar()
```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| (bool) | **RETURN** | True if a custom titlebar / custom menubar should be used
-------------------- --------------------
## Platform Checks ## Platform Checks

View File

@ -10081,6 +10081,89 @@ Test harness forces all windows to be modal and is no longer keep-on-top
- Set the main window `keep_on_top=False`. Ensures that all windows created by it should never be hidden. This is a somewhat experimental change. Let's hope for the best! - Set the main window `keep_on_top=False`. Ensures that all windows created by it should never be hidden. This is a somewhat experimental change. Let's hope for the best!
- Forced all windows except for 1 non-modal popup to be modal. This also should ensure no windows are "lost" behind the main window - Forced all windows except for 1 non-modal popup to be modal. This also should ensure no windows are "lost" behind the main window
## 4.60.0 PySimpleGUI 8-May-2022
TTK Scrollbars... the carpet now matches the drapes
Debug Window improvements
Built-in Screen-capture Initial Release
Test Harness and Settings Windows fit on small screens better
* Debug Window
* Added the `wait` and `blocking` parameters (they are identical)
* Setting to `True` will make the `Print` call wait for a user to press a `Click To Continue...` button
* Example use - if you want to print right before exiting your program
* Added `Pause` button
* If clicked, the `Print` will not return until user presses `Resume`
* Good for programs that are outputting information quickly and you want to pause execution so you can read the output
* TTK
* TTK Theme added to the PySimpleGUI Global Settings Window
* Theme list is retrieved from tkinter now rather than hard coded
* TTK Scrollbars
* All Scrollbars have been replaced with TTK Scrollbars
* Scrollbars now match the PySimpleGUI theme colors
* Can indicate default settings in the PySimpleGUI Global Settings Window
* Can preview the settings in the Global Settings Window
* Scrollbars settings are defined in this priority order:
* The Element's creation in your layout
* The Window's creation
* Calling `set_options`
* The defaults in the PySimpleGUI Global Settings
* The TTK Theme can change the appearance of scrollbars as well
* Impacted Elements:
* `Multiline`
* `Listbox`
* `Table`
* `Tree`
* `Output`
* Tree Element gets horizontal scrollbar setting
* `sg.main()` Test Harness
* Restructured the `main()` Test Harness to be more compact. Now fits Pi screens better.
* Made not modal so can interact with the Debug Window
* Turned off Grab Anywhere (note you can always use Control+Drag to move any PySimpleGUI window)
* Freed up graph lines as they scroll off the screen for better memory management
* Made the upgrade from GitHub status window smaller to fit small screens better
* Global Settings
* Restructured the Global Settings window to be tabbed
* Added ability to control Custom Titlebar. Set here and all of your applications will use this setting for the Titlebar and Menubar
* TTK Theme can be specified in the global settings (already mentioned above)
* New section for the Screenshot feature
* Exception handling added to `bind` methods
* Screenshots
* First / early release of a built-in screenshot feature
* Requires that PIL be installed on your system
* New `Window` method `save_window_screenshot_to_disk`
* Global Settings allows definition of a hotkey that triggers a save
* Popup is shown when hotkeys are used
* **To be clear** - PIL does not need to be installed in order to use PySimpleGUI. ONLY when a capture is attempted does PySimpleGUI try to import PIL
* It's the first step of building the larger "Gallery" feature
* The alignment is not perfect and the whole thing needs more work
* The auto-numbering freature is not yet implemented. Only 1 file is used and is overwritten if exists
* `user_settings_delete_filename` got a new parm `report_error` (off by default). The `UserSettings` object also got this parm to help control error reporting
* Themes (PySimpleGUI Themes)
* `theme_global` - added error checking and reporting should non-strandard theme names be attempted with this call
* New theme `Dark Grey 15`. Give it a try!
* New theme `Python Plus` - a more saturated blue and yellow colors. Give it a try!
* New function - `theme_button_color_background` - read-only call that returns the button background color. Previously only available as a tuple using `theme_button_color`.
* New function - `theme_button_color_text` - read-only call that returns the button text color. Previously only available as a tuple using `theme_button_color`.
* New function - `theme_use_custom_titlebar` returns `True` if Global Settings indicate custom titlebars should will be used
* `Output` Element - implementation changed to use the Multiline Element. No one should be impacted unless you were using some internal object details that was not published. I still suggest using the `Multiline` element instead so that you can access much more functionality.
* Tab errors now use the popup errors with traceback
* `Column` Element
* Fixed scrollwheel not working correctly when expand paramters used. Scrolls the canvas now not the frame.
* New `size_subsample_width` & `size_subsample_height` parameteres
* Gives much more control over the sizing of SCROLLABLE columns. Previously the size was set to 1/2 the required height and the full required width.
* The defaults are backward compatible (size_subsample_width=1, size_subsample_height=2)
* Setting both to 1 will make the Column fit the contents exactly. One use is when you expect your Column to grow or shrink over time. Or maybe you didn't like the 1/2 size that PySimpleGUI has always used before.
* Made Select Colors match the theme colors
* `Input`, `Multiline`, `Combo` elements now use matching colors for selections of characters (big-time thanks to Jason who also provided the magic code to make the combo drop-down match the theme)
* `popup_get_file` - Removed the file_types parameter use if on a Mac
* Missed catching this problem when added the no_window option
* Need to revisit this file types on the Mac topic in next release.
* Particularly bad problem because cannot catch the exception. Your code simply crashes. And the behavior isn't the same across all Macs.
* I'm really sorry Mac users that we keep running into these kinds of issues!
* Auto-correct file_types problems for Browse buttons. Automatically change the formatting from (str, str) to ((str, str),) and warns the user
* Docstring typo fixes for file_types parm
## Code Condition ## Code Condition
Make it run Make it run

View File

@ -2491,6 +2491,90 @@ Test harness forces all windows to be modal and is no longer keep-on-top
- Forced all windows except for 1 non-modal popup to be modal. This also should ensure no windows are "lost" behind the main window - Forced all windows except for 1 non-modal popup to be modal. This also should ensure no windows are "lost" behind the main window
## 4.60.0 PySimpleGUI 8-May-2022
TTK Scrollbars... the carpet now matches the drapes
Debug Window improvements
Built-in Screen-capture Initial Release
Test Harness and Settings Windows fit on small screens better
* Debug Window
* Added the `wait` and `blocking` parameters (they are identical)
* Setting to `True` will make the `Print` call wait for a user to press a `Click To Continue...` button
* Example use - if you want to print right before exiting your program
* Added `Pause` button
* If clicked, the `Print` will not return until user presses `Resume`
* Good for programs that are outputting information quickly and you want to pause execution so you can read the output
* TTK
* TTK Theme added to the PySimpleGUI Global Settings Window
* Theme list is retrieved from tkinter now rather than hard coded
* TTK Scrollbars
* All Scrollbars have been replaced with TTK Scrollbars
* Scrollbars now match the PySimpleGUI theme colors
* Can indicate default settings in the PySimpleGUI Global Settings Window
* Can preview the settings in the Global Settings Window
* Scrollbars settings are defined in this priority order:
* The Element's creation in your layout
* The Window's creation
* Calling `set_options`
* The defaults in the PySimpleGUI Global Settings
* The TTK Theme can change the appearance of scrollbars as well
* Impacted Elements:
* `Multiline`
* `Listbox`
* `Table`
* `Tree`
* `Output`
* Tree Element gets horizontal scrollbar setting
* `sg.main()` Test Harness
* Restructured the `main()` Test Harness to be more compact. Now fits Pi screens better.
* Made not modal so can interact with the Debug Window
* Turned off Grab Anywhere (note you can always use Control+Drag to move any PySimpleGUI window)
* Freed up graph lines as they scroll off the screen for better memory management
* Made the upgrade from GitHub status window smaller to fit small screens better
* Global Settings
* Restructured the Global Settings window to be tabbed
* Added ability to control Custom Titlebar. Set here and all of your applications will use this setting for the Titlebar and Menubar
* TTK Theme can be specified in the global settings (already mentioned above)
* New section for the Screenshot feature
* Exception handling added to `bind` methods
* Screenshots
* First / early release of a built-in screenshot feature
* Requires that PIL be installed on your system
* New `Window` method `save_window_screenshot_to_disk`
* Global Settings allows definition of a hotkey that triggers a save
* Popup is shown when hotkeys are used
* **To be clear** - PIL does not need to be installed in order to use PySimpleGUI. ONLY when a capture is attempted does PySimpleGUI try to import PIL
* It's the first step of building the larger "Gallery" feature
* The alignment is not perfect and the whole thing needs more work
* The auto-numbering freature is not yet implemented. Only 1 file is used and is overwritten if exists
* `user_settings_delete_filename` got a new parm `report_error` (off by default). The `UserSettings` object also got this parm to help control error reporting
* Themes (PySimpleGUI Themes)
* `theme_global` - added error checking and reporting should non-strandard theme names be attempted with this call
* New theme `Dark Grey 15`. Give it a try!
* New theme `Python Plus` - a more saturated blue and yellow colors. Give it a try!
* New function - `theme_button_color_background` - read-only call that returns the button background color. Previously only available as a tuple using `theme_button_color`.
* New function - `theme_button_color_text` - read-only call that returns the button text color. Previously only available as a tuple using `theme_button_color`.
* New function - `theme_use_custom_titlebar` returns `True` if Global Settings indicate custom titlebars should will be used
* `Output` Element - implementation changed to use the Multiline Element. No one should be impacted unless you were using some internal object details that was not published. I still suggest using the `Multiline` element instead so that you can access much more functionality.
* Tab errors now use the popup errors with traceback
* `Column` Element
* Fixed scrollwheel not working correctly when expand paramters used. Scrolls the canvas now not the frame.
* New `size_subsample_width` & `size_subsample_height` parameteres
* Gives much more control over the sizing of SCROLLABLE columns. Previously the size was set to 1/2 the required height and the full required width.
* The defaults are backward compatible (size_subsample_width=1, size_subsample_height=2)
* Setting both to 1 will make the Column fit the contents exactly. One use is when you expect your Column to grow or shrink over time. Or maybe you didn't like the 1/2 size that PySimpleGUI has always used before.
* Made Select Colors match the theme colors
* `Input`, `Multiline`, `Combo` elements now use matching colors for selections of characters (big-time thanks to Jason who also provided the magic code to make the combo drop-down match the theme)
* `popup_get_file` - Removed the file_types parameter use if on a Mac
* Missed catching this problem when added the no_window option
* Need to revisit this file types on the Mac topic in next release.
* Particularly bad problem because cannot catch the exception. Your code simply crashes. And the behavior isn't the same across all Macs.
* I'm really sorry Mac users that we keep running into these kinds of issues!
* Auto-correct file_types problems for Browse buttons. Automatically change the formatting from (str, str) to ((str, str),) and warns the user
* Docstring typo fixes for file_types parm
## Code Condition ## Code Condition
Make it run Make it run

View File

@ -3026,6 +3026,9 @@ Example: If first row has a `VPush`, then your layout will be At the bottom of
### save_to_disk ### save_to_disk
<!-- <+Window.save_to_disk+> --> <!-- <+Window.save_to_disk+> -->
### save_window_screenshot_to_disk
<!-- <+Window.save_window_screenshot_to_disk+> -->
### send_to_back ### send_to_back
<!-- <+Window.send_to_back+> --> <!-- <+Window.send_to_back+> -->
@ -3449,6 +3452,8 @@ The way to get Windows that have elements that have matching colors.
<!-- <+func.theme_background_color+> --> <!-- <+func.theme_background_color+> -->
<!-- <+func.theme_border_width+> --> <!-- <+func.theme_border_width+> -->
<!-- <+func.theme_button_color+> --> <!-- <+func.theme_button_color+> -->
<!-- <+func.theme_button_color_background+> -->
<!-- <+func.theme_button_color_text+> -->
<!-- <+func.theme_element_background_color+> --> <!-- <+func.theme_element_background_color+> -->
<!-- <+func.theme_element_text_color+> --> <!-- <+func.theme_element_text_color+> -->
<!-- <+func.theme_global+> --> <!-- <+func.theme_global+> -->
@ -3463,6 +3468,8 @@ The way to get Windows that have elements that have matching colors.
<!-- <+func.theme_slider_color+> --> <!-- <+func.theme_slider_color+> -->
<!-- <+func.theme_text_color+> --> <!-- <+func.theme_text_color+> -->
<!-- <+func.theme_text_element_background_color+> --> <!-- <+func.theme_text_element_background_color+> -->
<!-- <+func.theme_use_custom_titlebar+> -->
-------------------- --------------------

View File

@ -13632,6 +13632,20 @@ Parameter Descriptions:
|--|--|--| |--|--|--|
| str | filename | Filename to save the values to in pickled form | | str | filename | Filename to save the values to in pickled form |
### save_window_screenshot_to_disk
Saves an image of the PySimpleGUI window provided into the filename provided
```
save_window_screenshot_to_disk(filename = None)
```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| (PIL.ImageGrab or None) | **RETURN** | A PIL ImageGrab object that can be saved or manipulated
### send_to_back ### send_to_back
Pushes this window to the bottom of the stack of windows. It is the opposite of BringToFront Pushes this window to the bottom of the stack of windows. It is the opposite of BringToFront
@ -18689,6 +18703,32 @@ Parameter Descriptions:
|--|--|--| |--|--|--|
| (str, str) | **RETURN** | (str, str) - TUPLE with color strings of the button color currently in use (button text color, button background color) | (str, str) | **RETURN** | (str, str) - TUPLE with color strings of the button color currently in use (button text color, button background color)
Returns the button color background currently in use. Note this function simple calls the theme_button_color
function and splits apart the tuple
```
theme_button_color_background()
```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| (str) | **RETURN** | color string of the button color background currently in use
Returns the button color text currently in use. Note this function simple calls the theme_button_color
function and splits apart the tuple
```
theme_button_color_text()
```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| (str) | **RETURN** | color string of the button color text currently in use
Sets/Returns the background color currently in use for all elements except containers Sets/Returns the background color currently in use for all elements except containers
``` ```
@ -18864,6 +18904,20 @@ Parameter Descriptions:
|--|--|--| |--|--|--|
| (str) | **RETURN** | (str) - color string of the text background color currently in use | (str) | **RETURN** | (str) - color string of the text background color currently in use
Returns True if a custom titlebar will be / should be used.
The setting is in the Global Settings window and can be overwridden
using set_options call
```
theme_use_custom_titlebar()
```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| (bool) | **RETURN** | True if a custom titlebar / custom menubar should be used
-------------------- --------------------
## Platform Checks ## Platform Checks

View File

@ -10081,6 +10081,89 @@ Test harness forces all windows to be modal and is no longer keep-on-top
- Set the main window `keep_on_top=False`. Ensures that all windows created by it should never be hidden. This is a somewhat experimental change. Let's hope for the best! - Set the main window `keep_on_top=False`. Ensures that all windows created by it should never be hidden. This is a somewhat experimental change. Let's hope for the best!
- Forced all windows except for 1 non-modal popup to be modal. This also should ensure no windows are "lost" behind the main window - Forced all windows except for 1 non-modal popup to be modal. This also should ensure no windows are "lost" behind the main window
## 4.60.0 PySimpleGUI 8-May-2022
TTK Scrollbars... the carpet now matches the drapes
Debug Window improvements
Built-in Screen-capture Initial Release
Test Harness and Settings Windows fit on small screens better
* Debug Window
* Added the `wait` and `blocking` parameters (they are identical)
* Setting to `True` will make the `Print` call wait for a user to press a `Click To Continue...` button
* Example use - if you want to print right before exiting your program
* Added `Pause` button
* If clicked, the `Print` will not return until user presses `Resume`
* Good for programs that are outputting information quickly and you want to pause execution so you can read the output
* TTK
* TTK Theme added to the PySimpleGUI Global Settings Window
* Theme list is retrieved from tkinter now rather than hard coded
* TTK Scrollbars
* All Scrollbars have been replaced with TTK Scrollbars
* Scrollbars now match the PySimpleGUI theme colors
* Can indicate default settings in the PySimpleGUI Global Settings Window
* Can preview the settings in the Global Settings Window
* Scrollbars settings are defined in this priority order:
* The Element's creation in your layout
* The Window's creation
* Calling `set_options`
* The defaults in the PySimpleGUI Global Settings
* The TTK Theme can change the appearance of scrollbars as well
* Impacted Elements:
* `Multiline`
* `Listbox`
* `Table`
* `Tree`
* `Output`
* Tree Element gets horizontal scrollbar setting
* `sg.main()` Test Harness
* Restructured the `main()` Test Harness to be more compact. Now fits Pi screens better.
* Made not modal so can interact with the Debug Window
* Turned off Grab Anywhere (note you can always use Control+Drag to move any PySimpleGUI window)
* Freed up graph lines as they scroll off the screen for better memory management
* Made the upgrade from GitHub status window smaller to fit small screens better
* Global Settings
* Restructured the Global Settings window to be tabbed
* Added ability to control Custom Titlebar. Set here and all of your applications will use this setting for the Titlebar and Menubar
* TTK Theme can be specified in the global settings (already mentioned above)
* New section for the Screenshot feature
* Exception handling added to `bind` methods
* Screenshots
* First / early release of a built-in screenshot feature
* Requires that PIL be installed on your system
* New `Window` method `save_window_screenshot_to_disk`
* Global Settings allows definition of a hotkey that triggers a save
* Popup is shown when hotkeys are used
* **To be clear** - PIL does not need to be installed in order to use PySimpleGUI. ONLY when a capture is attempted does PySimpleGUI try to import PIL
* It's the first step of building the larger "Gallery" feature
* The alignment is not perfect and the whole thing needs more work
* The auto-numbering freature is not yet implemented. Only 1 file is used and is overwritten if exists
* `user_settings_delete_filename` got a new parm `report_error` (off by default). The `UserSettings` object also got this parm to help control error reporting
* Themes (PySimpleGUI Themes)
* `theme_global` - added error checking and reporting should non-strandard theme names be attempted with this call
* New theme `Dark Grey 15`. Give it a try!
* New theme `Python Plus` - a more saturated blue and yellow colors. Give it a try!
* New function - `theme_button_color_background` - read-only call that returns the button background color. Previously only available as a tuple using `theme_button_color`.
* New function - `theme_button_color_text` - read-only call that returns the button text color. Previously only available as a tuple using `theme_button_color`.
* New function - `theme_use_custom_titlebar` returns `True` if Global Settings indicate custom titlebars should will be used
* `Output` Element - implementation changed to use the Multiline Element. No one should be impacted unless you were using some internal object details that was not published. I still suggest using the `Multiline` element instead so that you can access much more functionality.
* Tab errors now use the popup errors with traceback
* `Column` Element
* Fixed scrollwheel not working correctly when expand paramters used. Scrolls the canvas now not the frame.
* New `size_subsample_width` & `size_subsample_height` parameteres
* Gives much more control over the sizing of SCROLLABLE columns. Previously the size was set to 1/2 the required height and the full required width.
* The defaults are backward compatible (size_subsample_width=1, size_subsample_height=2)
* Setting both to 1 will make the Column fit the contents exactly. One use is when you expect your Column to grow or shrink over time. Or maybe you didn't like the 1/2 size that PySimpleGUI has always used before.
* Made Select Colors match the theme colors
* `Input`, `Multiline`, `Combo` elements now use matching colors for selections of characters (big-time thanks to Jason who also provided the magic code to make the combo drop-down match the theme)
* `popup_get_file` - Removed the file_types parameter use if on a Mac
* Missed catching this problem when added the no_window option
* Need to revisit this file types on the Mac topic in next release.
* Particularly bad problem because cannot catch the exception. Your code simply crashes. And the behavior isn't the same across all Macs.
* I'm really sorry Mac users that we keep running into these kinds of issues!
* Auto-correct file_types problems for Browse buttons. Automatically change the formatting from (str, str) to ((str, str),) and warns the user
* Docstring typo fixes for file_types parm
## Code Condition ## Code Condition
Make it run Make it run