Merge pull request #2255 from PySimpleGUI/Dev-latest

Changes from the 4.6 release
This commit is contained in:
PySimpleGUI 2019-11-26 17:22:19 -05:00 committed by GitHub
commit f913577044
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 5843 additions and 1173 deletions

View File

@ -38,7 +38,7 @@ HOW DO I INSERT IMAGES ???
![Awesome Meter](https://img.shields.io/badge/Awesome_meter-100-yellow.svg) ![Awesome Meter](https://img.shields.io/badge/Awesome_meter-100-yellow.svg)
![Python Version](https://img.shields.io/badge/Python-2.7_3.x-yellow.svg) ![Python Version](https://img.shields.io/badge/Python-2.7_3.x-yellow.svg)
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-4.5.0-red.svg?longCache=true&style=for-the-badge) ![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-4.6.0-red.svg?longCache=true&style=for-the-badge)
![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_2.7_Version-2.4.1-blue.svg?longCache=true&style=for-the-badge) ![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_2.7_Version-2.4.1-blue.svg?longCache=true&style=for-the-badge)
![Python Version](https://img.shields.io/badge/PySimpleGUIQt_Version-0.28.0-orange.svg?longCache=true&style=for-the-badge) ![Python Version](https://img.shields.io/badge/PySimpleGUIQt_Version-0.28.0-orange.svg?longCache=true&style=for-the-badge)
@ -69,6 +69,8 @@ pip3 install pysimplegui
```python ```python
import PySimpleGUI as sg import PySimpleGUI as sg
sg.change_look_and_feel('DarkAmber') # Add a touch of color
# All the stuff inside your window. # All the stuff inside your window.
layout = [ [sg.Text('Some text on Row 1')], layout = [ [sg.Text('Some text on Row 1')],
[sg.Text('Enter something on Row 2'), sg.InputText()], [sg.Text('Enter something on Row 2'), sg.InputText()],
@ -90,7 +92,9 @@ window.close()
and returns the value input as well as the button clicked. and returns the value input as well as the button clicked.
![image](https://user-images.githubusercontent.com/13696193/61077153-cdfc0b00-a3eb-11e9-9e93-d6ec2ffb442a.png) ![image](https://user-images.githubusercontent.com/46163555/68713283-7cb38200-056b-11ea-990a-aa1603af5a11.png)
### Any Questions? It's that simple. ### Any Questions? It's that simple.
@ -106,7 +110,6 @@ and returns the value input as well as the button clicked.
* sitting on a Raspberry **Pi** with a touchscreen that's going to waste because you don't have the time to learn a GUI SDK? * sitting on a Raspberry **Pi** with a touchscreen that's going to waste because you don't have the time to learn a GUI SDK?
* into Machine Learning and are sick of the command line? * into Machine Learning and are sick of the command line?
* an IT guy/gal that has written some cool tools but due to corporate policies are unable to share unless an EXE file? * an IT guy/gal that has written some cool tools but due to corporate policies are unable to share unless an EXE file?
* wanting to distribute your Python code to Windows users as a single .EXE file that launches straight into a GUI, much like a WinForms app?
* want to share your program with your friends or families (that aren't so freakish that they have Python running) * want to share your program with your friends or families (that aren't so freakish that they have Python running)
* wanting to run a program in your system tray? * wanting to run a program in your system tray?
* a teacher wanting to teach your students how to program using a GUI? * a teacher wanting to teach your students how to program using a GUI?
@ -141,9 +144,10 @@ and returns the value input as well as the button clicked.
#### July-2019 Note - This readme is being generated from the PySimpleGUI.py file located on GitHub. As a result, some of the calls or parameters may not match the PySimpleGUI that you pip installed. #### July-2019 Note - This readme is being generated from the PySimpleGUI.py file located on GitHub. As a result, some of the calls or parameters may not match the PySimpleGUI that you pip installed.
## GUI Development does not have to be difficult nor painful. It can be FUN ## GUI Development does not have to be difficult nor painful. It can be (and is) FUN
#### What users are saying about PySimpleGUI #### What users are saying about PySimpleGUI
***(None of these comments were solicited & are not paid endorsements - other than a huge thank you they received!)*** ***(None of these comments were solicited & are not paid endorsements - other than a huge thank you they received!)***
"I've been working to learn PyQT for the past week in my off time as an intro to GUI design and how to apply it to my existing scripts... Took me ~30 minutes to figure out PySimpleGUI and get my scripts working with a GUI." "I've been working to learn PyQT for the past week in my off time as an intro to GUI design and how to apply it to my existing scripts... Took me ~30 minutes to figure out PySimpleGUI and get my scripts working with a GUI."
@ -162,7 +166,7 @@ and returns the value input as well as the button clicked.
"I love PySimpleGUI! I've been teaching it in my Python classes instead of Tkinter." "I love PySimpleGUI! I've been teaching it in my Python classes instead of Tkinter."
"I wish PySimpleGUI was available for every friggin programming language"
### START HERE - User Manual with Table of Contents ### START HERE - User Manual with Table of Contents
@ -184,7 +188,7 @@ and returns the value input as well as the button clicked.
[Repl.it Home for PySimpleGUI](https://repl.it/@PySimpleGUI) [Repl.it Home for PySimpleGUI](https://repl.it/@PySimpleGUI)
[Lots of screenshots](https://github.com/PySimpleGUI/PySimpleGUI/issues/1) [Lots of screenshots](https://www.bountysource.com/issues/60766522-screen-shots)
[How to submit an Issue](https://github.com/PySimpleGUI/PySimpleGUI/issues/1646) [How to submit an Issue](https://github.com/PySimpleGUI/PySimpleGUI/issues/1646)
@ -304,6 +308,7 @@ This makes the coding process extremely quick and the amount of code very small
```python ```python
import PySimpleGUI as sg import PySimpleGUI as sg
sg.change_look_and_feel('DarkAmber') # Add a little color to your windows
# All the stuff inside your window. This is the PSG magic code compactor... # All the stuff inside your window. This is the PSG magic code compactor...
layout = [ [sg.Text('Some text on Row 1')], layout = [ [sg.Text('Some text on Row 1')],
[sg.Text('Enter something on Row 2'), sg.InputText()], [sg.Text('Enter something on Row 2'), sg.InputText()],
@ -313,14 +318,16 @@ layout = [ [sg.Text('Some text on Row 1')],
window = sg.Window('Window Title', layout) window = sg.Window('Window Title', layout)
# Event Loop to process "events" # Event Loop to process "events"
while True: while True:
event, values = window.Read() event, values = window.read()
if event in (None, 'Cancel'): if event in (None, 'Cancel'):
break break
window.Close() window.close()
``` ```
![image](https://user-images.githubusercontent.com/13696193/61077153-cdfc0b00-a3eb-11e9-9e93-d6ec2ffb442a.png) ![image](https://user-images.githubusercontent.com/46163555/68713283-7cb38200-056b-11ea-990a-aa1603af5a11.png)
You gotta admit that the code above is a lot more "fun" looking that tkinter code you've studied before. Adding stuff to your GUI is ***trivial***. You can clearly see the "mapping" of those 3 lines of code to specific Elements laid out in a Window. It's not a trick. It's how easy it is to code in PySimpleGUI. With this simple concept comes the ability to create any window layout you wish. There are parameters to move elements around inside the window should you need more control. You gotta admit that the code above is a lot more "fun" looking that tkinter code you've studied before. Adding stuff to your GUI is ***trivial***. You can clearly see the "mapping" of those 3 lines of code to specific Elements laid out in a Window. It's not a trick. It's how easy it is to code in PySimpleGUI. With this simple concept comes the ability to create any window layout you wish. There are parameters to move elements around inside the window should you need more control.
@ -841,6 +848,13 @@ Your program have 2 or 3 windows and you're concerned? Below you'll see 11 wind
![pyplot 1](https://user-images.githubusercontent.com/13696193/44683336-11d46480-aa14-11e8-9d6c-f656796fc915.jpg) ![pyplot 1](https://user-images.githubusercontent.com/13696193/44683336-11d46480-aa14-11e8-9d6c-f656796fc915.jpg)
Just because you can't match a pair of socks doesn't mean your windows have to all look the same gray color. Choose from over 100 different "Themes". Add 1 line call to `change_look_and_feel` to instantly transform your window from gray to something more visually pleasing to interact with. If you mispell the theme name badly or specify a theme name is is missing from the table of allowed names, then a theme will be randomly assigned for you. Who knows, maybe the theme chosen you'll like and want to use instead of your original plan.
In PySimpleGUI release 4.6 the number of themes was dramatically increased from a couple dozen to over 100. To use the color schemes shown in the window below, add a call to `change_look_and_feel('Theme Name)` to your code, passing in the name of thd desired color theme. To see this window and the list of available themes on your releeae of softrware, call the function `preview_all_look_and_feel_themes()`. This will create a window with the frames like those below. It will shows you exactly what's available in your version of PySimpleGUI.
![Nov 2019 Look and Feel Themes](https://user-images.githubusercontent.com/46163555/68987669-91a54500-07f9-11ea-921e-8bf9320e3156.png)
Make beautiful looking, alpha-blended (partially transparent) Rainmeter-style Desktop Widgets that run in the background. Make beautiful looking, alpha-blended (partially transparent) Rainmeter-style Desktop Widgets that run in the background.
![cpu cores dashboard 2](https://user-images.githubusercontent.com/13696193/47611749-18964c80-da42-11e8-93c4-6821a6fce488.gif) ![cpu cores dashboard 2](https://user-images.githubusercontent.com/13696193/47611749-18964c80-da42-11e8-93c4-6821a6fce488.gif)

File diff suppressed because it is too large Load Diff

View File

@ -834,7 +834,31 @@ Let's hope it doesn't all blow up in our faces!
* Fix in popup_get_files when 0 length of filename * Fix in popup_get_files when 0 length of filename
* Fix in Window.SetIcon - properly sets icon using file with Linux now. Was always defaulting * Fix in Window.SetIcon - properly sets icon using file with Linux now. Was always defaulting
## 4.6 PySimpleGUI 16-Nov-2019
* Themes!!!
* Added a LOT of Look and Feel themes. Total < 100 now
* Doctring comments for some missing functions
* PEP8 bindings for button_rebound_collback, set_tooltip, set_focus
* Spin Element Update - shortened code
* Allow tk.PhotoImage objeft to be passed into Image.update as the data
* DrawRectangle - added line_width parameter. Defaults to 1
* Fix for Slider - was only setting the trough color if the background color was being set_focus
* Added a deiconify call to Window.Normal so it can be used to restore a window that has been minimized. Not working on Linux
* Combo - Fix for not allowing a "0" to be specified as the default
* Table - Saving the Frame that contains a table in the member variable table_frame. This will enable the frame to be changed to expandable in the future so that the table can be resized as a window expands.
* LOTS AND LOTS of Look and Feel themes!!!!
* Added SystemDefaultForReal to look and feel that will prodce 100% not styled windows
* Changed the "gray" strings in look and feel table into RGB strtings (e.g. gray25 = #404040). No all graphics subsystems
* Removed Mac restriction from Look and Feel setting changes. All color settings are changed EXCEPT for the button color now on a Mac
* "Fuzzy Logic" Look and Feel Theme Selection - No longer have to memorize every character and get the case right. Now can get "close enough" and it'll working
* New function - preview_all_look_and_feel_themes. Causes a window to be shown that shows all of the currently available look and feel themes
* Removed use of CloseButton in popup get file, folder, text. Was causing problems where input fields stopped working. See bug on GitHub
### Upcoming ### Upcoming
Make suggestions people! Future release features Make suggestions people! Future release features

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@ for i in psg_funcs:
continue continue
print('') print('')
print(f'<!-- <+func.{i[0]}+> -->') print(f'<!-- <+func.{i[0]}+> -->')
# print('\n'.join(['\t' + j[0] for j in inspect.getmembers(i[1]) if '_' not in j[0] ])) print('\n'.join(['\t' + j[0] for j in inspect.getmembers(i[1]) if not j[0].startswith('_')]))
sg.Popup() sg.Popup()
sg.Button() sg.Button()

File diff suppressed because it is too large Load Diff

View File

@ -24,12 +24,12 @@ psg_classes = list(zip([i.__name__ for i in psg_classes_], psg_classes_))
for i in sorted(psg_classes): for i in sorted(psg_classes):
if 'Tk' in i[0] or 'TK' in i[0] or 'Element' == i[0]: # or 'Window' == i[0]: if 'Tk' in i[0] or 'TK' in i[0] or 'Element' == i[0]: # or 'Window' == i[0]:
continue continue
print(f'### {i[0]} Element') print(f'## {i[0]} Element')
print('') print('')
print(f'<!-- <+{i[0]}.doc+> -->') print(f'<!-- <+{i[0]}.doc+> -->')
print(f'<!-- <+{i[0]}.__init__+> -->') print(f'<!-- <+{i[0]}.__init__+> -->')
print('') print('')
print('\n'.join([f"#### {j[0]}\n\n<!-- <+{i[0]}.{j[0]}+> -->\n" for j in inspect.getmembers(i[1]) if '_' not in j[0] ])) print('\n'.join([f"### {j[0]}\n\n<!-- <+{i[0]}.{j[0]}+> -->\n" for j in inspect.getmembers(i[1]) if not j[0].startswith('_') ]))
print('\n------------------------- Functions start here -------------------------\n') print('\n------------------------- Functions start here -------------------------\n')