Skip to content

Commit 55d1bf1

Browse files
authored
Merge pull request PySimpleGUI#5453 from PySimpleGUI/Dev-latest
Release 4.60.0
2 parents 7024819 + 66931d5 commit 55d1bf1

File tree

7 files changed

+376
-147
lines changed

7 files changed

+376
-147
lines changed

PySimpleGUI.py

Lines changed: 11 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -1,154 +1,10 @@
11
#!/usr/bin/python3
22

3-
version = __version__ = "4.59.0.45 Released 5-Apr-2022"
3+
version = __version__ = "4.60.0 Released 8-May-2022"
44

55
_change_log = """
6-
Changelog since 4.59.0 released to PyPI on 5-Apr-2022
7-
8-
4.59.0.1
9-
Addition of the blocking parameter to the Print function. Enables using Print through an entire program with the last
10-
Print call setting the blocking parameter so that the window doesn't close until user interacts with the Debug Output Window
11-
4.59.0.2
12-
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.
13-
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
14-
turn off this error checking temporarily
15-
4.59.0.3
16-
NEW ttk scrollbars added to Multiline, Listbox, Table and Tree
17-
Tree element - added new horizontal scrollbar (also uses the new ttk scrollbar)
18-
Parameters added to Mulitline, Listbox, Table and Tree to control the scrollbar styling
19-
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
20-
4.59.0.4
21-
New Window screencapture that uses PIL if you've got PIL installed.
22-
It does NOT require PIL be installed in order to use PySimpleGUI. ONLY when a capture is attempted does PySimpleGUI try to import PIL
23-
It's the first step of building the larger "Catalog" feature
24-
The alignment is not perfect and the whole thing needs more work
25-
The keystrokes used to perform the cpature, the locatoin the file is stored and the filename are al in the PySimpleGUI global settings
26-
The auto-numbering freature is not yet implemented. Only 1 file is used and is overwritten if exists
27-
4.59.0.5
28-
Fixed the font and sizing of the "Editor Settings" section
29-
Niocer abnner at the top of the window
30-
4.59.0.6
31-
Added exception handing to the bind methods
32-
4.59.0.7
33-
More exception handling
34-
4.59.0.8
35-
New Debug Print capability - The "Pause/Resume" option enables printing to be paused. This will block the caller
36-
Added ability to control use of Custom Titlebar from the system settings. Turn on Customer Titlebar setting in the
37-
Global System Settings and that will cause all windows to automatically use a custom titlebar and custom menubar
38-
New theme call to determine if a custom titlebar shoue be used - theme_use_custom_titlebar returns True if should use one
39-
Main test harness
40-
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
41-
Window is not modal so can interact the debug Print window
42-
Grab anywhere turned off - Remember can always use CONTROL + LEFT CLICK & DRAG to move ANY PySimpleGUI as if grab anywhere is enabled
43-
4.59.0.9
44-
Made the save window as image into a Window method - Window.save_window_screenshot_to_disk
45-
Show a popup message when a window save is performed using the keys specified in the system settings
46-
Debug Print still has some problems so be warned for the time being... it's being worked on...
47-
4.59.0.10
48-
Ugh .... terrible ttk theme bug! Sorry!!!
49-
4.59.0.11
50-
Improved TTK theme error reporting
51-
4.59.0.12
52-
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
53-
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
54-
4.59.0.13
55-
theme_global - added error checking and reporting about non-standard theme names being attempted
56-
Dark Grey 15 - NEW theme! (inspired by the theme_global issue :-)
57-
4.59.0.14
58-
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
59-
Removed the "Thumb Color" and "Thumb Depressed" ttk slider parms... it's not a settable option generally speaking so it had to go.
60-
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
61-
Completed the first draft of the TTK Scrollbar settings in the Global settings window... was a LOT more work than I estimated!
62-
4.59.0.15
63-
TTK Theme added to the System Settings :-)
64-
Made the ttk scrollbar settings tab look nicer
65-
4.59.0.16
66-
Added button to test ttk scrollbar settings within the System Settings window. Aids in changing the design if scrollbar colors, sizes, etc.
67-
4.59.0.17
68-
Noted tricky problem - if "always use custom titlebar" is set in system settings, then USER still needs to account for this in their layout
69-
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
70-
Made MenubarCustom have a pad=0 by default so that it's snug under the titlebar and extends to edges correctly.
71-
Renamed ttk scrollbar system settings tab to ttk
72-
4.59.0.18
73-
Got the Debug Print stuff working right! YES!
74-
Added new parm "wait" which is an alias for the "blocking" parm. Some may like it better. Take your choice
75-
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
76-
4.59.0.19
77-
OK... this time got the Debug Print stuff working right for real! YES? ;-)
78-
4.59.0.20
79-
irony - when you accidently leave debug prints in your debug print code
80-
4.59.0.21
81-
Additional exception handling needed for debug window closure at any point
82-
4.59.0.22
83-
"Ding-dong the Output's dead" - finally replaced the Output element with Multiline by subclassing Multiline
84-
This solves a bunch of problems including duplication of funcationality using 2 different techniques.
85-
Problem may be in backward compatibility if anyone is using internal Output element member variables, etc.
86-
4.59.0.23
87-
Changed the popup errors for Tabs to be popup error with traceback. Much nicer experience with this newer error popup
88-
Removed Output Element from the packer function... you know it's really gone when it's not in there
89-
To be clear, there still is an Output Element... it's just a Multiline in disguise now.
90-
4.59.0.24
91-
Support for the GrayGrayGray theme with the new ttk scrollbars... for those that like the grayscale world, you're now safe
92-
4.59.0.25
93-
Fix for systems that don't yet have the ttk scrollbars set up. Was getting the incorrect defaults (they were all blank)
94-
4.59.0.26
95-
Debug window - betting re-opening code so that the data is not missed from being printed
96-
4.59.0.27
97-
ttk scrollbar support for Column element - was really hacked in to get things to work. Next step is a little cleanup but want to
98-
first simply make sure it's working. Changes were limited to the scrollable column class (which was the scene of the hack-crime too)
99-
4.59.0.28
100-
fixed the Column.update call! Missed the renaming of the ExpandX to expand_x in that function. Sorry if you hit it!
101-
4.59.0.29
102-
Added parms and docstrings to all elements with ttk scrollbars
103-
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
104-
4.59.0.30
105-
Get ttk themes available from ttk rather than the hard coded list. This is used in the Global Settings window.
106-
4.59.0.31
107-
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
108-
Added support for the heirarchical specification of ttk scrollbars. The settings will be picked up in this order:
109-
Element, Window, Set Options, Global Settings
110-
4.59.0.32
111-
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.
112-
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!)
113-
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.
114-
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
115-
already taking forever... (insert eyeroll emoji here)
116-
Removed "Use TTK Scrollbars" checkbox in global settings... you're getting TTK scrollbars whether you like it or not ;-)
117-
Prettied up the ttk settings tab in global settings
118-
4.59.0.33
119-
New Column element parameters - size_subsample_width & size_subsample_height
120-
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.
121-
The defaults are backward compatible (size_subsample_width=1, size_subsample_height=2)
122-
Setting both to 1 will make the Column fit the contents exactly.
123-
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.
124-
Hoping this isn't too complex to understand!
125-
4.59.0.34
126-
Fix crash in Element.bind... likely created in version 4.59.0.6.
127-
Crashes because Elements don't have the method _is_window_created which was being called. YIKES!
128-
4.59.0.35
129-
New coupon
130-
4.59.0.36
131-
Made selected text color for Input, Combo and Multiline match the color theme! (THANK YOU JASON!)
132-
4.59.0.37
133-
Added back the filetypes parameter availability for the mac for the file browse operations. Was previously (incorrectly evidently!) removed for FileBrowse operations
134-
(Thank you resnbl for all the help!)
135-
4.59.0.38
136-
Combo element finally gets drop-down list formatting (thank you Jason!)
137-
4.59.0.39
138-
Reworked sg.main test harness to recover space to fit on smaller screens
139-
Make upgrade from github Multiline smaller to fit the Pi screen
140-
4.59.0.40
141-
Auto-correct file_types problems for Browse buttons. Automatically change the formatting from (str, str) to ((str, str),) and warn the user
142-
4.59.0.41
143-
Docstring typo fixes for file_types parm
144-
4.59.0.42
145-
FileBrowse - giving a series of try blocks a try to see if can get around the Mac file_types issue
146-
4.59.0.43
147-
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.
148-
4.59.0.44
149-
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
150-
4.59.0.45
151-
Fix for Scrollable Columns that expand. Needed to switch to using the canvas, not the frame, for scrolling (THANK YOU Jason and milahu!)
6+
Changelog since 4.60.0 released to PyPI on 8-May-2022
7+
1528
"""
1539

15410
__version__ = version.split()[0] # For PEP 396 and PEP 345
@@ -18961,6 +18817,14 @@ def theme_add_new(new_theme_name, new_theme_dict):
1896118817

1896218818

1896318819
def theme_use_custom_titlebar():
18820+
"""
18821+
Returns True if a custom titlebar will be / should be used.
18822+
The setting is in the Global Settings window and can be overwridden
18823+
using set_options call
18824+
18825+
:return: True if a custom titlebar / custom menubar should be used
18826+
:rtype: (bool)
18827+
"""
1896418828
if USE_CUSTOM_TITLEBAR is False:
1896518829
return False
1896618830

docs/call reference.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13632,6 +13632,20 @@ Parameter Descriptions:
1363213632
|--|--|--|
1363313633
| str | filename | Filename to save the values to in pickled form |
1363413634

13635+
### save_window_screenshot_to_disk
13636+
13637+
Saves an image of the PySimpleGUI window provided into the filename provided
13638+
13639+
```
13640+
save_window_screenshot_to_disk(filename = None)
13641+
```
13642+
13643+
Parameter Descriptions:
13644+
13645+
|Type|Name|Meaning|
13646+
|--|--|--|
13647+
| (PIL.ImageGrab or None) | **RETURN** | A PIL ImageGrab object that can be saved or manipulated
13648+
1363513649
### send_to_back
1363613650

1363713651
Pushes this window to the bottom of the stack of windows. It is the opposite of BringToFront
@@ -18689,6 +18703,32 @@ Parameter Descriptions:
1868918703
|--|--|--|
1869018704
| (str, str) | **RETURN** | (str, str) - TUPLE with color strings of the button color currently in use (button text color, button background color)
1869118705

18706+
Returns the button color background currently in use. Note this function simple calls the theme_button_color
18707+
function and splits apart the tuple
18708+
18709+
```
18710+
theme_button_color_background()
18711+
```
18712+
18713+
Parameter Descriptions:
18714+
18715+
|Type|Name|Meaning|
18716+
|--|--|--|
18717+
| (str) | **RETURN** | color string of the button color background currently in use
18718+
18719+
Returns the button color text currently in use. Note this function simple calls the theme_button_color
18720+
function and splits apart the tuple
18721+
18722+
```
18723+
theme_button_color_text()
18724+
```
18725+
18726+
Parameter Descriptions:
18727+
18728+
|Type|Name|Meaning|
18729+
|--|--|--|
18730+
| (str) | **RETURN** | color string of the button color text currently in use
18731+
1869218732
Sets/Returns the background color currently in use for all elements except containers
1869318733

1869418734
```
@@ -18864,6 +18904,20 @@ Parameter Descriptions:
1886418904
|--|--|--|
1886518905
| (str) | **RETURN** | (str) - color string of the text background color currently in use
1886618906

18907+
Returns True if a custom titlebar will be / should be used.
18908+
The setting is in the Global Settings window and can be overwridden
18909+
using set_options call
18910+
18911+
```
18912+
theme_use_custom_titlebar()
18913+
```
18914+
18915+
Parameter Descriptions:
18916+
18917+
|Type|Name|Meaning|
18918+
|--|--|--|
18919+
| (bool) | **RETURN** | True if a custom titlebar / custom menubar should be used
18920+
1886718921
--------------------
1886818922

1886918923
## Platform Checks

0 commit comments

Comments
 (0)