Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Announcements #142

Open
MikeTheWatchGuy opened this issue Sep 6, 2018 · 532 comments
Labels

Comments

@MikeTheWatchGuy
Copy link
Collaborator

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 6, 2018

Announcements - New Features, Design Patterns, and Methods

I'm unsure how GitHub sends out updates. I don't think people are informed about Wiki changes for example. I've been announcing new features and more importantly, new ways of doing things, on the Wiki. I'm going to put announcements here so they are more visible. If there are objections about the traffic, well, what can I say, it's a busy/active project.

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 6, 2018

New use pattern - Element lookup using Keys

keys can be used to lookup Elements. As a result, all Elements are capable of having a key, including non-output elements such as a Text Element.

To get an element object from a form, you call
form.FindElement(key)

This is the new, preferred method for doing Updates on elements.

Previously if you wanted to output something to a Text Element, you needed to create the text element outside of the form layout and keep that text element variable around so you can call text_element. Update('new text')

The new design pattern is thus:
In your form layout, include a key on your Element:

layout = [[sg.Text('My text', key='text')]]

Later in your code you can update this Text Element by making this call, assuming the variable form is your FlexForm object:

form.FindElement('text').Update('new text')

The Demo programs have all been updated to use this new technique. This capability and its impact on the length of programs led to pushing version 2.30 out the door quickly.

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 6, 2018

Borderless Windows are Here

Try them on your next form.
Add this to your FlexForm call:
no_titlebar = True

You can expect to see some of these in the Demo programs.

borderless grayed buttons

You can click anywhere on the window and drag to move it. Don't forget to put an exit key on these windows.

Be sure and make an "exit" button or you'll be running task manager to close your windows. The reason is the when you turn on this option, you will not see an icon on your taskbar for the window. This happens on both Windows and Linux. Thus, if you do not supply an exit button, the user will have no means to close the window.

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 7, 2018

Grab Anywhere

Tonight's change is perhaps going to be a really cool thing or one that is going to piss people off.

But, hey, I like it this way. If you don't, setgrab_anywhere = Falsein your call to FlexForm.

As the name implies, you can grab and drag your window using any point on the window, not just the title bar. I was only enabling this when the title bar was turned off. I think it's a much superior way to interact with a window.

FlexForm is becoming quite the call!
def __init__(self, title, default_element_size=DEFAULT_ELEMENT_SIZE, default_button_element_size = (None, None), auto_size_text=None, auto_size_buttons=None, scale=(None, None), location=(None, None), button_color=None, font=None, progress_bar_color=(None, None), background_color=None, is_tabbed_form=False, border_depth=None, auto_close=False, auto_close_duration=DEFAULT_AUTOCLOSE_TIME, icon=DEFAULT_WINDOW_ICON, return_keyboard_events=False, use_default_focus=True, text_justification=None, no_titlebar=False, grab_anywhere=True):

So, enjoy a lazy way of interacting with windows on me.

You will want to turn if off for forms with a SLIDER. you need the slider to move, not the window. I'll update the Demos that use sliders to turn off the grab_anywhere.

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 7, 2018

Tables

This one has been requested a number of times. Rather than make a Table Element, decided to see if the current PySimpleGUI is capable of making nice tables using standard Elements. The answer seems to be yes, it's possible with existing Elements. The key was to enable text justification in the InputText element. By right justifying the text in those Elements, it's possible to create a nice looking table.

Here's an example using a ComboBox and Input Elements.

light table

You'll find the code that generated the table in the file Demo_Table_Simulation.py. It requires the latest PySimpleGUI from GitHub in order to use the justification setting.

This is a "live keyboard" demo. It updates the table values as you are typing.

There are 3 fields at the top of the table. If you enter a value into the 3rd field, the cell that the other 2 cells represents will be changed to that value. Enter 1, 2, 1234 and cell (1,2) will be changed to 1234.

There is a new trick demonstrated in this demo that shows off the power of Python. Rather than pass in a string as the key to the Input Elements, I passed a tuple. Nothing about the key requires it to be a string. The only requirement is that you use the same type to look up the element when you call FindElement or use the key to read the return values.

This is the code that makes the Input Elements:

    for i in range(20):
        inputs = [sg.In('{}{}'.format(i,j), size=(8, 1), pad=(1, 1), justification='right', key=(i,j), do_not_clear=True) for j in range(10)]

See how the key is set to (i,j). This allow me to easily find the Element that is represented by (i,j) later. What to access the cell at (0,0)? This you would make this call:
form.FindElement((0,0))

Hopefully this is enough capability for the folks that need tables in their forms/window.

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 7, 2018

Three Point Oh!

So maybe I kinda screwed up the numbering when the last one became 2.30. I didn't think about it looking like 2.3 also. Doh!

There have been a lot of changes lately so perhaps it's time for a major bump.

It's a clean slate

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 8, 2018

keep_on_top = True

What might this setting do in a call to FlexForm? If you guessed create a window that's ways on top you're right.

This one little flag enables cool floating toolbars that stay on top of all of your other windows. I'll admit a large portion of this project is for selfish purposes, that I have a platform to develop tools on top of.

Now I've got this nifty toolbar on the top part of my screen, always ready to launch or do something.

floating launcher

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 8, 2018

3.0.2 release today to turn off the grab_anywhere feature for non-blocking forms. tkinter is printing out a warning/error message when the form is closed using a button. Doesn't appear to have any effect on the overall functioning, but it's distressing to see. Better to disable this feature for now.

Plan is to add back an override mechanism should a user want it.

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 8, 2018

RELEASED 3.0.2

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 8, 2018

Floating Toolbar - New demo program

This is an always-on-top, compact floating toolbar. They are super-handy to leave running. Something satisfying about writing code that then gets used often, especially if they make you much more efficient.

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 9, 2018

Async Forms

Updated the Readme / primary doc to discuss the use of non-block forms.

As explained in the documentation there are a number of techniques to move away from async forms including using the change_submits = True parameter for elements and return_keyboard_events = True

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 9, 2018

Floating Desktop Widgets

I've discovered that in about 30 lines of code you can create a floating desktop widget.

snap0276

If you click the pause button, it switches to Run.

snap0275

This "Widget" is always on top of the other windows.

Looking for a way of launching these in a way that have no taskbar icons. If launched from PyCharm it behaves this way. If launched from a Toolbar, the toolbar's window is attached to the timer. Close it and the timer closes.

This demo is the first time I've ever combined a ReadNonBlocking with a Read in the same form. The reason for using it in this program is that while the timer is paused, there' s nothing happening so why have the program running the loop when it can wait for the user to do something like click a button. When the button is clicked we return from the Read call.

Thank you to jfong for sending an interesting version of this program. His ideas have rolled into a into the project code many times.

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 10, 2018

Menus are done

The last of the big features, Menus, was just released to GitHub. With it comes the ability to get the look and feel of a windows program. I don't know if the architecture will lend itself to being used this way or not, but it did seem like a useful feature to add..

snap0204

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 10, 2018

3.7 Support

Thanks to @mrstephenneal we can now say that PySimpleGUI works on Python 3.7. There was a button issue causing trouble. Looks like it's fixed now so I think 3.7 is now safe to with PSG.

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 10, 2018

Release 3.01.00

Menus! (and a Listbox.Update bug) are the big features.

Since the Menu code is somewhat isolated, and I want to get some users on it, decided to go ahead and push it all out there in 3.01.00

I didn't mention this in the readme section on menus, but by default (you can't currently turn it off) menus are detachable. If you double-click the dashed line then you get a floating version of that menu. Should make for some pretty interesting user interfaces?

tear off

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 10, 2018

3.1.1

There have been enough bug fixes to trigger another PyPI release. People have been doing more and more with the Update method. These fixes were mostly in those methods.

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 11, 2018

Update methods updated

Added the ability to enable / disable all input elements.
Set parameter disable=True to disable, disable=False to enable, disable=None to leave it alone

A number of Demo programs also refreshed.

Expect a PyPI release soon.

Note that some Update method changes also changed parameter names from new_value to value, new_values to values. Some were different than others. Removed new_ so they all match now. Sorry to those living on the bleeding edge!

Here's a before/after. Elements towards the bottom of the window were disabled.

Yes, even buttons can be disabled now. No more needing to gray out your own buttons!

enabled
disabled

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 11, 2018

3.1.2

Big change this time around is the ability to disable widgets. All input widgets have an Update method that has the parameter disabled that you set to True if you want to disable it.

A few critical bugs in there too which pushed up the release to today.

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 12, 2018

Resizable Windows, Font settings for input text elements, beginnings of Treeview Element

You can stretch windows bigger now and some of the elements will resize with the window. **

The Input Text Elements did not have a functioning Font setting. Doh! Don't know how that got missed.

The very beginnings of the Treeview element are in there.

Hopefully nothing was broke. Any time I make changes to the core widget packing I get nervous!

** Had to turn off some of the Resizable windows features....Buttons and other elements were moving / expanding in forms that I didn't want the to expand. The change fucked up too many elements to leave on for now.

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 12, 2018

Two new Demo programs - CPU Desktop Widget, Spinner Compound Element

Added another Desktop Widget to the demos. This one shows the CPU utilization.

cpu widget

The spinner allows you to change how often it's refreshed

The Spinner Compound Element was done in response from a user wanting to see a different kind of spinner. This one has larger buttons and is laid out horizontally.

spinner compound

The point of this demo is that it's possible to put together multiple Elements into a higher level element. There aren't many of these I can think of at the moment, but given how many user questions are asked, something else is bound to be asked for.

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 13, 2018

Table Element, Complete rework of Popups, Death of MsgBox

You can blame the Popup changes on this issue:
#204

All of the Popups were rewritten to use a long list of customization parameters. The base Popup function remained more or less the same.

Decided while I was going all the Popup work that it's time to completely remove MsgBox. Sorry all you early adopters. You'll need to do a bulk rename and then you'll be fine.

Table Elements

Finally have something to show in the form of tables. The element name is Table. While the tkinter Treeview widget was used, many of the parameters were not exposed. If they were, the caller could really mess things up. Better to present a nice "Table-friendly'" interface than something specific to tkinter. After all, the plan is to expand PySimpleGUI to use other GUI frameworks.

A Demo program is in the works.

It's possible to add scrollbars to the Table element by simply placing it into a Column element.

There's still work to do and a good number of bugs, but I encourage you to give it a try.

scrolled table

If you do not put the Table Element inside of a Column, then you can still view and scroll the table, it just will not have scrollbars.

There is a problem currently with keyboard input when placed into a Column. The keyboard keys work fine when NOT inside of the Column but stop working when placed inside a Column Element.

This program will read a CSV file and display it in a window.

import csv
import PySimpleGUI as sg

filename = sg.PopupGetFile('filename to open', no_window=True, file_types=(("CSV Files","*.csv"),))
# --- populate table with file contents --- #
data = []
if filename is not None:
    with open(filename, "r") as infile:
        reader = csv.reader(infile)
        try:
            data = list(reader)  # read everything else into a list of rows
        except:
            sg.PopupError('Error reading file')
            exit(69)

sg.SetOptions(element_padding=(0, 0))

col_layout = [[sg.Table(values=data, headings=[x for x in range(len(data[0]))], max_col_width=8,
                        auto_size_columns=False, justification='right', size=(8, len(data)))]]

layout = [[sg.Column(col_layout, size=(1200,600), scrollable=True)],]

form = sg.FlexForm('Table', grab_anywhere=False)
b, v = form.LayoutAndRead(layout)

It's another bit of PySimpleGUI "challenge code"..... The challenge is to do the same operation in another GUI framework in less lines of code. I would enjoy seeing the tkinter code required to create the window that this 20 line PySimpleGUI program creates. Most of the code deals with reading the CSV file 👍

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 14, 2018

Linux Virtual Environment

I finally installed VirtualBox and am running Ubuntu Linux. I tried to install the Mint distro, but the display was scrambled when it booted.

I was surprised how close the Linux screen shots look to the Windows.

ping graph linux
toolbar linux
all linux
ping linux

Even Pong worked the first time.

I don't believe that Python has been labelled the "go to language" for doing cross-platform GUI work. I guess I never stopped to think about it. I don't recall seeing this kind of thinking in posts or books I've read on Python. Perhaps it's time for that to change?

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 14, 2018

3.2.0

Released a new release to PyPI. Sorry about all these releases, but features continue to pour into the code. I'm finding even the folks that are actively using PySimpleGUI only run the pip installed version rather than the GitHub version. That means if I want runtime on the code, I'm only going to get any is to do a full release.

There were a number of changes that could f-up, so be on the lookout. The biggest addition to 3.2.0 was the Table Element (beta quality at the moment).

If you are running older programs then you may crash due to missing functions, MsgBox and several others. This is because I've moved 100% to Popup calls. It's not like I haven't been warning people so I don't expect complaints.

Some people are calling ReadNonBlocking prior to your Event Loop so that the form gets fully made. This call is needed if you want to perform actions on elements prior to calling Read. For example, if you want your form to be shown with some Elements set in the disabled state (using calls to Update), you will need to make an additional call after your Layout call.

Instead of calling ReadNonBlocking in these situations, you can call Finalize/PreRead/PrepareForUpdate. I have not been able to standardize on a name, so I'm providing multiple. I'm sure a winner will emerge. I've been using Finalize.

The call sequence becomes this:

form.Layout(layout)
form.Finalize()
element.Update(.....)
while True:
     b, v = form.Read()

You'll also find the Finalize call used in the scripts that use the Canvas Element.

See the Readme for more info on what's in the release. Note that the readme has not yet been updated with the Table Element and several other changes. There's only so much I can do.

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 15, 2018

One Line Progress Meters

PySimpleGUI has always had a one-line progress meter called EasyProgressMeter. However, that function has a limitation of only 1 meter being active at a time.

The new way to do Progress Meters is the function OneLineProgesssMeter.

All of the documentation and examples will reflect this new function.

Have to say it's nice to be able to run as many meters as desired without having to worry about more than 1 being on the screen at a time.

I intend to remove EasyProgressMeter within the next 5 or 6 releases to PyPI. I tried to insert a warning in the code, but too much code was shared to fit the message in.

I'm sorry about the change, but really would like to both add this function and rename the capability to something very descriptive. If there is enough revolt over removing EasyProgressMeter, I'll leave it in and simply drop it from all the documentation.

onelineprogressmeters

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 15, 2018

3.3.0

Yea, yea, it seems like only yesterday that version 3.2.0 was released. That's because it WAS only yesterday. I've been busy.

There are 2 changes I wanted out quickly....

  1. The ability to turn off displaying row numbers
  2. The new OneLineProgressMeter function

The Progress Meter feature alone is a great use of PySimpleGUI. A number of users are using it only for this purpose in their programs.

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 16, 2018

Graphing

New demo program - graph ping using canvas.
I'm thinking about creating a Graph Element, something that makes it super easy to users tog create graphs, both line and x,y plot. The demo should how to take a canvas element and graph ping times.

There is another ping-graph demo using Matplotlib. This graph only uses tkinter.

Finally, because the pings take a long time, I moved the ping calls outside of the GUI event loop. Calling ping inside event loop was causing the GUI to respond sluggishly. This is because the ping was taking 1 second which means the gui wasn't being refreshed / wasn't responsive during the second. Now the GUI sleeps for 200 ms while the ping is done by a thread.

This is yet another toe in the water with threading. The problems I saw in the past are no longer there, it would appear.

I also checked in the ping.py file that you need for this demo. It's a pure python implementation of ping and works pretty well, even if slow.

ping graph

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 16, 2018

Progress Meters

Thanks to @JorjMcKie I've learned more about the performance of the EasyProgressMeter and thus probably the OneLineProgressMeter. The more arguments to display the longer it takes.

Was going to document in the Cookbook / Readme that if you have performance concerns, you can call the progress meter less frequently. You don't have to update it 1 count at a time. It could be like this:

for i in range(10000):
    if i % 5 == 0: sg.OneLineProgressMeter('My 1-line progress meter', i+1, 10000, 'single')

This meter is only called every 5 times through the loop. It finished quite a bit quicker than the test updating the meter every single time.

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 16, 2018

PySimpleGUI programs as an EXE file!

The biggest thing to hit PySimpleGUI since Colors.... the ability to run programs written for PySimpleGUI as an exe file. ALL credit goes to @JorjMcKie for this.

There is no need to distribute Python with your programs. It's all included in the exe and folder of supporting files.

From what I understand of nuitka, this code is compiled C++ code, not python code. The performance is thus potentially better! It's the best of both worlds.

Working to get the process documented. It's tricky and required a special script. Stay tuned....

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 16, 2018

Graph Element

This one is pretty exciting as it does something new on the screen. The Graph Element allows you to easily create a canvas and draw on it using your own coordinate system. You don't need to do conversions from your graph coordinates to the tkinter canvas graph coordinates.

The Demo program for it is a good example. It displays a pint graph. The graph we're creating is a line graph what we would like to to from 0,0 in the bottom left to 100, 500 in the upper right. This will give us 100 data points along the x axis and up to 500 ms on the y axis.

After creating the Graph Element, we can do 3 operations on it:

  1. Draw Line
  2. Draw Point
    3 Erase

The draw line draws a line from 1 point to another. The points are specified using your graph coordinates, not the tkinter canvas coordinates.

snap0282

I know I have a LOT of documentation to do.

In the meantime, try using Control+P if you're using PyCharm. Press Control+P while you are typing in the parameters and you'll see a popup showing you what the legal parameters are. This feature is almost necessary when using PySimpleGUI because functions have SO many optional parameters.

snap0283

I hope to see some cool creations using the capability. I'm starting to see more and more projects pop up on GitHub that use PySimpleGUI! Keep those examples coming! And keep the requests for new features coming too. They have made this such a better package because of your help.

Sample code:

This is your layout:

    layout = [  [sg.T('Ping times to Google.com', font='Any 18')],
               [sg.Graph((300,300), (0,0), (100,500),background_color='white', key='graph')],
               [sg.Quit()]]

    form = sg.FlexForm('Canvas test', grab_anywhere=True)
    form.Layout(layout)

To draw a line, call DrawLine:

form.FindElement('graph').DrawLine(from_point, to_point)

@MikeTheWatchGuy

This comment has been minimized.

Copy link
Collaborator Author

@MikeTheWatchGuy MikeTheWatchGuy commented Sep 17, 2018

Movable Graph Element

Made the Graph Element "movable". This means the graph can be shifted when it reaches the "End".

Here's a 1,000 data-point ping graph or 16 minutes woth of pining

scrollingping

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Sep 16, 2019

New YouTube Video That Uses PySimpleGUI

This one is the latest: https://www.youtube.com/watch?v=x5LSTDdffFk&feature=youtu.be

It's short at only 6 minutes, but the animations and explanations are thorough and very pleasant to watch. Wow, so nice to see it being taught like this.

The code for it is here: https://github.com/israel-dryer/PyDataMath-II

There are actually 2 videos he's made so far using PySimpleGUI. They are both excellent in my opinion.

This was the first one: https://www.youtube.com/watch?v=IWDC9vcBIFQ


I yet again learn something cool and awesome by reading someone else's PySimpleGUI code. I'm sure many of you recall that I create a function when I have Elements that have a lot of settings that are used over and over.

His approach was entirely different. What he did was he made a dictionary of the repeated parameters and then passed those in.

bw = {'size':(7,2), 'font':('Franklin Gothic Book', 24), 'button_color':("black","#F8F8F8")}
bt = {'size':(7,2), 'font':('Franklin Gothic Book', 24), 'button_color':("black","#F1EABC")}
bo = {'size':(15,2), 'font':('Franklin Gothic Book', 24), 'button_color':("black","#ECA527"), 'focus':True}

Then in his layout:
  [sg.Button('7',**bw), sg.Button('8',**bw), sg.Button('9',**bw), sg.Button("*",**bt)],

VERY clever and one that I'll be stealing for sure :-)

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Sep 20, 2019

Element.set_size Experiment?

Just added to the tkinter port is the general ability, for all elements (in theory), the ability to "resize".

To set the size for an element, you call that element's set_size function, just like you would update or set_focus.

As mentioned in the Enhancement Issued opened to track the progress, with this call you can set one of the sizes to None so that only 1 is changed. The parameter passed in is a single variable which is a tuple of 2 ints.

Here's a bit of demo code:

import PySimpleGUI as sg

layout = [  [sg.Text('My Window', key='-TEXT-', background_color='lightblue')],
            [sg.Input(key='-IN-'), sg.Text('', key='-OUT-')],
            [sg.Button('Do Something'), sg.Button('Exit')]  ]

window = sg.Window('Window Title', layout, resizable=False)

while True:             # Event Loop
    event, values = window.read()
    print(event, values)
    if event in (None, 'Exit'):
        break
    if event == 'Do Something':
        window['-TEXT-'].set_size((20,3))
        window['-TEXT-'].Update('1\n2\n3')
        window['Exit'].set_size((None,2))       # Change only the height... one of the ONLY times None can be used in a size
window.close()

Please comment to the Issue if you end up using it or had problems with it.
#2004

Enjoy!

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Sep 20, 2019

Matplotlib Lives Again! (Ver 3.1.1) - Happy Data Science Day!

We've been help up for a little bit, unable to use 3.1 with PySimpleGUI. I'm happy to be able to announce that Matplotlib version 3.1.x works with PySimpleGUI again! You can safely pip install the newest Matplotlib now and it'll work with PySimpleGUI. If you have older code working with Matplotlib, you'll need to switch to this new method in order to upgrade your code.

While PySimpleGUI integrates with Matplotlib, it's technically not a "feature". It's an "Integration" with demo programs supplied to demonstrate one way to accomplish integration.

BIG thank you goes out to @Em-Bo and @dirck for their help!

All of the Matplotlib demos, save two, have been updated to reflect the changes:
Demo_Matplotlib.py
Demo_Matplotlib_Animated.py
Demo_Matplotlib_Animated_Scatter.py (which animates faster now)
Demo_Matplotlib_Browser.py
Demo_Matplotlib_Browser_Paned.py

Not done are these 2 ping demos:
Demo_Matplotlib_Ping_Graph.py
Demo_Matplotlib_Ping_Graph_Large.py

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Sep 20, 2019

Ability to get screen size regardless of window present

Previously with PySimpleGUI-tkinter, you could get the screen dimensions after you created you window by calling window.GetScreenDimensions(), but it only worked if you had a window already opened (thus the little 'w' on window).

Now you can call the class method Window.get_screen_size() with a window already opened or not:

import PySimpleGUI as sg

print(sg.Window.get_screen_size())

This should some in handy for people that are trying to set initial window sizes to match some portion or all of the available screen real estate.

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Sep 21, 2019

PySimpleGUI Discovers Twitter

It stumbled onto the Twitter folks by accident last year. Tony, a teacher from Australia, was the first I can recall that tweeted something about it.

The PySimpleGUI Twitter id is @PySimpleGUI

(I just changed the ID)

Had my mind blown yesterday when there was a post of a screenshot of a code editor made with PySimpleGUI that was running a Calculator program that was written in PySimpleGUI.

https://twitter.com/PySimpleGUI/status/1175191301890936832

Can't wait to get my hands on this code... want to run the PySimpleGUI code editor inside of the PySimpleGUI code editor that is running a PySimpleGUI Demo program. It could go as deep as you want I would assume.

Anyway, if you're a Twitter person, please feel free to share your PySimpleGUI stuff. There IS a community there that is enjoying seeing what each other is creating. I'm still new, but it seems like a nicer community than some others.


I am such a newbie at Twitter I didn't know you can change the name. When I tried to sign up with PySimpleGUI, it gave me @SimplePy. I didn't know I could change it! I could SWEAR I tried in the past.

I don't know what will happen if someone uses the old ID but I'm going to stick with the new
@PySimpleGUI

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Sep 25, 2019

PySimpleGUI Runs on Trinket.io

Happy to announce that another platform is available to run PySimpleGUI online besides repl.it. I did have to get a paid account, but it's cheap.

Here's the demo program for Conway's game of life:
https://trinket.io/library/trinkets/447e96f4d4

Here's a demo of a recent mock-up I did for a Reddit post
https://trinket.io/library/trinkets/3fed5650f4

The downside to trinket.io is that I have to include ALL of the source required for the project, including PySimpleGUI.py.

Still, trinket looks cleaner than repl.it to the user. It's a simple "run" button without a bunch of output scrolling past that makes no sense to most people.

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Sep 30, 2019

More Trinket.io

I've been really putting some time into the Trinket.io examples as I work on Reddit and other problems. It's difficult to get the entire list of my programs out to you. It seems like the only way is by creating a "Lesson" and adding the programs to that.

https://trinket.io/pysimplegui/courses/demo-programs#/demo-programs

It also now has me thinking that perhaps putting the GitHub demo programs on either Trinket or Repl.it could be a great thing, That's a LOT of porting as there are 180+ programs at the moment.

There is also the problem on trinket that I have to include the entire PySimpleGUI.py file as part of the project. With repl.it PySimpleGUI is automatically loaded via pip so that you get the latest and greatest released version.

So, I'm torn. Trinkit's overall experience and interface feels cleaner and easier for the end user to operate. But it's got this architecture flaw of having to include the PySimpleGUI.py file. This seems fine for the Reddit posts I'm using it for.

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Oct 1, 2019

0.13.0 1-OCT-2019 PySimpleGUIWx

FINALLY PySimpleGUIWx released to PyPI!
Really sorry about the delay. The release notes among other things slowed me down.

  • Version numbering using sg.version string
  • PEP8 bindings!
  • Improved scaling of character to pixel sizes of elements that are multilined
  • Added Metadata variable to all elements
  • Renamed element callback functions to start with _
  • Removed del methods everywhere except Output Element
  • Can "Call" an element which will call its Update method
  • InputText element - convert default text and password char to string
  • Removed old code such as tkinter's tooltip and drag and drop from Qt
  • Shortcut I for InputText
  • Listbox added size_px parm
  • Changed type checking to use the comment style types
  • Added Element.Widget to all Elements so can access the Wx widgets directly
  • Text Element now defaults to '' so no need to specify anything if a blank Text Element (often used for output)
  • Button text converted to string when creating button
  • New Button shortcuts - B, Btn
  • VerticalSeparator - Newly supported Element
  • HorizontalSeparator - Newly supported Element
  • Slider - added size_px parm
  • Fixed leak caused by System Tray not cleaning up the timer
  • Window - added finalize paramter so can skip using chained .Finalize()
  • Window - AllKeysDict now used like other PySimpleGUI ports. Has all the keys and elements in a window
  • Window.FindElement - added silent_on_error parm like other ports have
  • Window[key] construct added that calls FindElement
  • window() - can "Call" a window you've created. Will call Window.Read()
  • Popup buttons no longer use CloseButtons for normal popups. Calls window.Close manually
  • PopupGetFolder changed to use keys, normal button, new window design patterns
  • PopupGetFile changed to use keys, normal buttons, new window design patterns
  • PopupGetText changed to use keys, normal buttons, new window design patterns
  • Default application (PySimpleGUI.main) now shows the version number like other PySimpleGUI ports
@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Oct 3, 2019

2,200 ⭐ 503,000 Installs

Hit 2 milestones today! (or close to today)

Thankfully stars are not downvotable 🙄

Have also been waiting for a while to hit the 500,000 total installs mark, both seemed to have happened this week or thereabouts.

Here is how each port contributes to the total:
image
image
image
image
image

THANK YOU PySimpleGUI users!! You're the BEST GitHub community ever!

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Oct 7, 2019

The Cleanest PySimpleGUI Code

These examples may very well be some of THE best, cleanest, most modern pieces of PySimpleGUI code I've seen, and I read all the PySimpleGUI code I can. He uses type hints, or some kind of typing as it's beyond me at the moment. I'm still living in 3.5/3.6 world as the Pi is still stuck at 3.5.

Meet Israel Dryer's Notepad code - a less than 100 line PySimpleGUI program that implements a basic text editor with menus and other features you would expect.

It's portable and runs online on Trinket for example.

He also made perhaps THE best PySimpleGUI video, where he teaches you PySimpleGUI along with how to build a calculator based off an actual vintage TI calculator.

He also wrote a CODE EDITOR that also runs on Trinket. This code does some wild stuff with styling the windows, setting "themes". Has excellent menus. His stuff is very "complete" and polished. I'm pretty jealous as he out PySimpleGUI's me, easily.

Israel is one to watch for innovative uses of PySimpleGUI as well as how to utilize the Python language better while writing PySimpleGUI code.

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Oct 16, 2019

A GitHub Star Graph

I ran into an interesting tool that graphs the number of stars a project has over time.

Here's the graph of PySimpleGUI's GitHub stars over time:
PySimpleGUI alone

Hmmm..... not very interesting... just a slow gradual growth.

Then I started adding other projects.

star graph PySimpleGUI

It would seem that PySimpleGUI is doing pretty good!

I didn't include Kivy because it has over 10,000 stars across a 10 year span. The graph gets distorted.

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Oct 20, 2019

Streaming Media Player!

We've got another homerun program from Israel Dryer! This time it's a media player.

This is incredible, truly incredible. Super-easy to understand code. It's at 125 now, but hasn't been "compressed" at all.

With a few minor changes that took maybe 4 minutes, it was up and running on PySimpleGUIQt. Now quite able to get it to run on PySimpleGUIWeb just yet.

image

I played with an earlier version and made it a borderless window. Really spiffy.

image

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Oct 24, 2019

Speed of Fixes, Project expectations

When there is a problem that a user reports, it's a frustrating experience, for everyone, not just the user reporting a problem. If you personally feel like the level of support, the effort to help or the stability of the software is not now or will not be in the future, up to your level of expectations, then please don't use PySimpleGUI. You've got other choices. Go with Qt and a paid license if you need corporate level support as it's simply not possible here.

PySimpleGUI is free software. The time spent creating it was donated, the time spent supporting users is donated, and the money paid to consultants to help from time to time to helps speed things up is donated. It has taken days, nights and weekends to get to this point and continues to take that kind of effort. Quite simply there isn't enough time nor ability to be perfect, to respond in a way that meets everyone's expectations, to run a flaw-free project. Life outside this project is preciously short and has been for almost 2 years.

I understand the form that accompanies Issue submissions can be a pain in the ass. I don't know exactly how long it takes to fill out, but I can't imagine it being an hour or more. There are other open source projects that utilize similar forms, many of which are much more strict in rejecting even partially filled out submissions. Every bug system I've seen and worked with has similar data that is collected with every submission. GitHub's Issue lists are not a bug database so these forms projects use are an attempt to re-create the capabilities of a normal bug tracking system. It's far from perfect.

One problem is that some users have never seen a bug database. Many are not professional software developers. The result could be that some people feel really put-out by the Issue resolution process. It's for efficiency purposes that Issues have these forms. It's an attempt to get you, the user, back up and running ASAP. If there is any doubt there, then again, this may not be the package for you. Damn, that's a terrible thing to say, but it's honest and an attempt to short-cut your frustration. Turning away users goes against everything this software was written for.

This is not a fun announcement to make. It's one of the least fun in fact. If there's a summary here, I would say it's that there are only so many hours available for this project and there are SO many more activities that need doing that those hours provide. Some projects take weeks to reply to an issue and every attempt will be made to ensure this isn't one of them. However, there can't be any promises made on how quickly your problem will be fixed. A fast workaround is often attempted to get you on the road again, but that's not always a possibility.

I ask for your help and understanding when asking for assistance. Your problem is the most important and highest priority thing for you, but if you can step back a little and see there are other people in the same boat and the project also needs to continue to move forward, then maybe it'll help with your frustration at the inability to address problems on your timeline that meet your expectations. Patience is requested and very much appreciated.

I'm really grateful for the support and encouragement users have shown over the past couple of years. It is very appreciated. Thank you for your time, and I'm sorry if any of you have been disappointed.

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Oct 24, 2019

Mouse Vs Python Article by Mike Driscoll

My all-time favorite Python book author, Mike Driscoll, has written a short article on PySimpleGUI!

http://www.blog.pythonlibrary.org/2019/10/23/a-brief-intro-to-pysimplegui/

It's posted on his "Mouse Vs. Python" blog and being picked up by a number of newsletters. This is super exciting as Mike's helped my Python education along through his books. Python 101 has to be a favorite as I learned a lot of stuff about the standard library I didn't know (for example the daemon setting on Threads).

I think that Mike may write something larger in the future as he's a writer for RealPython. THAT would be something to see!

Here are some of the books Mike's written that you may recognize

  • Python 101 - (eBook or Paperback or read it online)
  • Python 201: Intermediate Python - (eBook or Paperback)
  • wxPython Recipes - (eBook or Paperback)
  • Python Interviews - (eBook or Paperback)
  • ReportLab: PDF Processing with Python - (eBook or Paperback)
  • Jupyter Notebook 101 - (eBook or Paperback)
  • Creating GUI Applications with wxPython - (eBook or Paperback)

His most recent book, very recently published, is the WxPython book, so he's very very up on GUIs.

It's going to be fantastic to hear feedback from Mike! It's a great opportunity that will no doubt help improve the package.

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Oct 29, 2019

Thank you for following naming / coding conventions!

Lagging behind on updating some of the docs, particularly the cookbook and readme. It's important to keep those up to date with the latest coding conventions (design patterns). They are the vehicle in which names and design patterns are shown, repeatedly, until you're brainwashed into naming your variables the same thing.

I want to applaud the consistency that the community has shown using the package. It's another unexpected outcome. The project has been riddled with these kinds of unexpected results. I read lots of PySimpleGUI code. As much as I can because I learn from it. What I'm seeing is consistency pretty much across the board. It's pretty cool

By consistency and coding conventions I mean the variable names, program structure, etc. 99% of the time I see

import PySimpleGUI as sg

and

layout = [[   ]]

window = sg.Window('title', layout)

event, values = window.read()

It may sound like I'm being picky when encouraging people to follow these but it has this huge advantage of any of us being able to pick up another's PySimpleGUI code and read it. It's easy to scan a page of code and find the event loop, where the input value are being used, etc.

The big one I'm trying to get switched over to at the moment is the replacement of FindElement with [ ]. But even if that change isn't made by everyone, the FindElement or find_element are easy to spot as well.

Seemed like something worthy of thanking the community for doing. It does have a positive impact in the end I think. Other people that are perhaps behind you in their skills have a chance to learn from you, .... take your code. .... and your artwork. 😉

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Oct 30, 2019

Mini Media Player Anyone?

https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_Media_Player_VLC_Based.py

image

It plays back:

  • Files from your hard drive
  • YouTube links
  • DropBox links (set dl=1 in the shared link)

Another winner demo program added courtesy of Israel Dryer. Stole his bare-bones media player that's part of his larger feature rich media player and turned it into a Demo Program. Changes were coding convention stuff, etc, nothing major that's for sure.

It's maybe 55 lines of code? PyCharm says 70, but 15 lines of that are comments. Need to write a little utility to display actual lines of code. It's ridiculously small. And even then, check out how difficult these lines are in the event loop:

    if event == 'play':
        list_player.play()
    if event == 'pause':
        list_player.pause()
    if event == 'stop':
        list_player.stop()
    if event == 'next':
        list_player.next()
        list_player.play()
    if event == 'previous':
        list_player.previous()      # first call causes current video to start over
        list_player.previous()      # second call moves back 1 video from current
        list_player.play()

Could it be done in less code using a dictionary or something, sure, but WHY? It would add significant complexity. It's not worth saving some code if you lose something so beautifully simple as this. The player buttons and how the player reacts is all right there in one place.

Code is present to allow running on Linux but I still need to test.

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Oct 31, 2019

Notification Window - Fades in and out, click to dismiss

There's a new demo program that I think many of you will find useful and adds a very nice touch to your program.

https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_Notification_Window_Fade_In_Out.py

This code displays a notification "window" that fades in and out and can be dismissed early by clicking on it.

Demo Notification Window

The foundation for this code was sent by user @ncotrb who was nice enough to donate it to the pool of demo programs.

The unique features of this program include:

  • Option to fade in / out the window
  • Changing the mouse pointer from an arrow to a hand when over the window
  • Entire window is drawn using a single Graph Element

I was trying to turn this demo into an something callable that would run this code as a subprocess, the idea being the ability to display a notification window at any point in a user's program regardless of the state of the caller's program or even which GUI framework is being used. Wasn't able to take the idea that far so perhaps someone else can make a try at it.

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Oct 31, 2019

Reddit New PySimpleGUI Post

https://www.reddit.com/r/learnpython/comments/dpo0a8/first_pysimplegui_project/

image

( gist link is this - https://gist.github.com/quirksubdol/8390e53e70db2c03cb05ecf22408ca1e )

It's nice to see success stories.

What's remarkable about this program is that it was done by a student in their second week of a Python course. Talk about ambitious!

[EDIT] A day later and it continues to be upvoted :-) Nice! I'm glad the poster is feeling good about what he's done.

image

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Nov 1, 2019

Another article!?

What's better than having your favorite Python author write a story about PySimpleGUI? I'll tell you what.... it's having TWO stories written! In under a week too!

http://www.blog.pythonlibrary.org/2019/10/31/the-demos-for-pysimplegui/

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Nov 2, 2019

My Favorite Tweet

Total newcomer to Twitter, but finding it a fascinating place for Python stuff. Never used it for anything until a few months back.

Here's my favorite Tweet I've seen so far

SNAG-0532

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Nov 3, 2019

Code sharing for Issues

I've been using Trinket to share code instead of Pastebin or pasting into a post somewhere. The reason is that people can immediately run the code.

If you are able to post your code on either Trinket or Repl.it to demonstrate a problem, I can guarantee you that you're issue IS going to get looked at quicker and ahead of others. The difference between "follow this link and see the behavior" and "add whatever code you need to in order to get my 5 lines of code to run" is like "biking to the grocery store" versus "taking a roundtrip to Mars"

One advantage these 2 platforms give you to try your code out on is that they are Linux based (perhaps you're running Windows / Mac or running a different Linux). It's another data point.

I'm not asking that everyone put their Issue code on Trinket. It just dawned on me how handy it is for troubleshooting in addition to demonstrating or teaching.

Maybe it's a terrible idea :-) I've got lots of ideas, they're not all good however.

EDIT.... oops, I forgot to share this bit of Trinket code as an example:
https://trinket.io/library/trinkets/49c5d264d8

import PySimpleGUI as sg

layout = [  [sg.Text('My Window')],
            [sg.Input(key='-IN-'), sg.Text('', key='-OUT-')],
            [sg.Button('Do Something'), sg.Button('Exit'),
             sg.Button('-FOCUS-IN-', visible=False), sg.Button('-FOCUS-OUT-', visible=False)]  ]

window = sg.Window('Window Title', layout, finalize=True)

window.TKroot.bind("<FocusIn>", window['-FOCUS-IN-'].ButtonReboundCallback)
window.TKroot.bind("<FocusOut>", window['-FOCUS-OUT-'].ButtonReboundCallback)

has_focus = True
while True:             # Event Loop
    event, values = window.read()
    if event in (None, 'Exit'):
        break
    if event == '-FOCUS-IN-' and not has_focus:
        print('Got focus!')
        has_focus = True
    elif event == '-FOCUS-OUT-' and has_focus:
        print('Leaving focus!')
        has_focus = False

window.close(); del window

This code was part of explaining how to get new "events" to be returned through calls to window.read().

It's one thing to see it, it's different to run it.

BTW, this particular extension to PySimpleGUI was only recently added and is not yet been released to PyPI from what I recall. It's on GitHub.

The idea here is to bind a tkinter event to a method in a Button. Yes, it's clunky for the time being. The point is to get you something that works with a small amount of code until a better way is written. It opens up a LOT of extending of PySimpleGUI for what little is added.

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Nov 4, 2019

Screenshots - All of them but need fewer

I've had problems posting screenshots for people to see because GitHub will hide 100's of posts in an Issue from you. I found this site BounySource that archives GitHub best I can tell and doesn't hide any posts so that you can scroll through them all.

What's needed is maybe to put a few of the better ones in the Wiki???

I'm not sure of what the "better ones" would be. It's on the list to do... along with get the code written.....

https://www.bountysource.com/issues/60766522-screen-shots
https://www.bountysource.com/issues/79595971-screenshots-scratchpad-for-posting-and-documents

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Nov 6, 2019

Release 4.5 PySimpleGUI 04-Nov-2019

FINALLY a release goes out and this is a big one!

Sorry it's taken SO long. The readme has finally been updated with the PEP8 bindings and evidently exceeds GitHub's size for the project's homepage. The ReadTheDocs still works though http://www.PySimpleGUI.org

  • Metadata!
    • All elements have a NEW metadata parameter that you can set to anything and access with Element.metadata
    • Windows can have metadata too
  • Window.finalize() - changed internally to do a fully window.read with timeout=1 so that it will complete all initializations correctly
  • Removed typing import
  • ButtonReboundCallback - Used with tkinter's Widget.bind method. Use this as a "target" for your bind and you'll get the event back via window.read()
  • NEW Element methods that will work on a variety of elements:
    • set_size - sets width, height. Can set one or both
    • get_size - returns width, heigh of Element (underlying Widget), usually in PIXELS
    • hide_row - hides the entire row that an element occupies
    • unhide_row - makes visible the entire row that an element occupies
    • expand - causes element to expand to fill available space in X or Y or both directions
  • InputText Element - Update got new parameters: text_color=None, background_color=None, move_cursor_to='end'
  • RadioButton - fix in Update. Was causing problems with loading a window from disk
  • Text Element - new border width parameter that is used when there's a relief set for the text element
  • Output Element - special expand method like the one for all other elements
  • Frame element - Can change the text for the frame using Update method
  • Slider element - can change range. Previously had to change value to change the range
  • Scrollable frame / column - change to how mousewheel scrolls. Was causing all things to scroll when scrolling a single column
    • NOTE - may have a bad side effect for scrolling tables with a mouse wheel
  • Fix for icon setting when creating window. Wasn't defaulting to correct icon
  • Window.get_screen_size() returns the screen width and height. Does not have to be a window that's created already as this is a class method
  • Window.GetScreenDimensions - will return size even if the window has been destroyed by using get_screen_size
  • Now deleting window read timers every time done with them
  • Combo no longer defaults to first entry
  • New Material1 and Material2 look and feel color schemes
  • change_look_and_feel has new "force" parameter. Set to True to force colors when using a Mac
  • 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
@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Nov 6, 2019

0.31.0 PySimpleGUIWeb 04-Nov-2019

It's been a LONG LONG time since a PySimpleGUIWeb release. So it's overdue, especially since the PEP8 binding have been held up. I've been wanting to make sure the animations would be flicker free before releasing again and thankfully the Remi team (of one) came through again! The OpenCV demos run in a browser as a result.

  • PEP8 bindings!
  • Window - NEW way of finding elements
    • Use window[key] instead of window.FindElement(key)!!
  • Winow - "calling" an existing window object will call its read method
  • Version number added both dunder version and version work
  • Renamed some variables to be private by adding _ to the front
  • METADATA added to all elements and Window
  • Ability to "call" an element. The effect is to call that element's update method
  • Removed all delete functions in the classes. Were poorly done and not consistent
  • Output element - fix for color defaults, CurrentValue contains all of the text currently shown
  • Image Element
    • Rewrite done by Remi team!!!
    • Fixes flicker when using with OpenCV
  • Removed quite a bit of unused code
  • Added prints where items are not yet implemented
  • Window - finalize parameter added
  • Get screen dimensions always returns (0,0) for now until can figure it out
  • Made return values computation easier
  • Two new look and feel color settings - Material1, Material2
@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Nov 7, 2019

Meme Anyone?

I've never made a Meme, but I did make this illustrative diagram, perhaps for use when people go nuts online about how sh*tty PySimpleGUI is. I think it illustrates the point well. LOL.

I'm not knocking any other GUI package. They all have their purpose and "best use" scenario. I think you guys here on this GitHub already get this or you wouldn't be the awesome users you are. I dunno, a little humor goes a long ways, even if a tad sarcastic.

image

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Nov 8, 2019

Posting Issues - Do NOT post your new issue as an addition to a closed issue

A problem has recently started happening where users with a problem simply tack their problem onto the end of a Closed Issue. This is a terrible problem. It circumvents the entire bug reporting, tracking, and ultimately bug fixing process. It also provides much less information than if a new issue was opened.

It's fine, of course, to reference a closed issue in your new open issue... by all means do that.

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Nov 8, 2019

PySimpleGUIWeb 0.31.1 posted to PyPI

There was a corrupt init file that was uploaded as part of the PySimpleGUIWeb release that I didn't catch. Thankfully someone else did and reported it quickly.

I'm really sorry this happened! I'll strive to do a better job of testing the uploaded code in addition to installing it. I HATE BUGS, so it's appreciated when they're reported early like this rather than giving up and moving onto something else, assuming someone else will post something.

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Nov 8, 2019

New Matplotlib Demo

Managed to get an interactive Matplotlib window to run in parallel with a PySimpleGUI window. The reason for doing this is if the user wishes to use the interactive tools that a Matplotlib window normally shows. It's actually really simple. Simple enough to post here:

import PySimpleGUI as sg
import matplotlib.pyplot as plt

"""
    Simultaneous PySimpleGUI Window AND a Matplotlib Interactive Window
    A number of people have requested the ability to run a normal PySimpleGUI window that
    launches a MatplotLib window that is interactive with the usual Matplotlib controls.
    It turns out to be a rather simple thing to do.  The secret is to add parameter block=False to plt.show()
"""

layout = [[sg.Button('Plot'), sg.Cancel(), sg.Button('Popup')]]
window = sg.Window('Have some Matplotlib....', layout)

while True:
    event, values = window.read()
    if event in (None, 'Cancel'):
        break
    elif event == 'Plot':
        history = [0.1, 0.2, 0.5, 0.7]
        plt.plot(history)
        plt.show(block=False)
    elif event == 'Popup':
        sg.popup('Yes, your application is still running')
window.close()
@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Nov 8, 2019

0.31.0 PySimpleGUIWeb 08-Nov-2019

It's getting to be like the old days of weekly releases. Whew!

I got more help from the Remi team!!!!!!!!! (Thank you Davide!!!)

Now the Output element scrolls correctly as does the MultilineOutput. Very nice to get this kind of help from such an expert.

So, I thought it important to push it out the door to everyone quickly.

@PySimpleGUI

This comment has been minimized.

Copy link
Owner

@PySimpleGUI PySimpleGUI commented Nov 10, 2019

Cookbook Updates

Released the first set of a series of updates to the Cookbook. This first set were for the initial sections, the first set of design patterns, and some PEP8 renaming. Hopefully 90% or more of the PEP8 conversions are done in that document. It's been released to readthedocs.

You might not know it, but it's available via: http://Cookbook.PySimpleGUI.org

I've had some excellent suggestions of things to add. One in particular is layout explanations.

I want to rework the multi-window patterns into something much more useful than the straight linear representation that's posted now.

Much more work still ahead for it as it's the active portion of the project at this moment.

Main docs Table Of Contents "fixed" for Elements

Was reported on Reddit as a problem... there were no entries at all for the call reference section. I guess the code changed or something that caused the header levels to get messed up. I've changed it so that the elements now show up in the table of contents (http://www.PySimpleGUI.org).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.