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

You may like the Push element #1

Closed
PySimpleGUI opened this issue Jan 8, 2022 · 11 comments
Closed

You may like the Push element #1

PySimpleGUI opened this issue Jan 8, 2022 · 11 comments

Comments

@PySimpleGUI
Copy link

Hi!

💗 seeing what you're making. Thank you for posting screenshots in some of your repos!

I learn a lot from users so when I can find a few minutes, I like to take a look at what users are making.

For this project, I liked that you used a Column element for actual columns. I've not done a layout the way you did on this project. It removes the need to set a size of the left-most Text elements.

A new element was added last year that has made justification much easier... the Push element.

Here is your original window

image

I recreated it by making these changes:

  • Removed the use of Columns
  • I added a size parameter to the Text elements that are on the first 2 rows
  • Removed the size on the output Text element. Setting no size on Text elements now does the more logical thing (a change last year). The element will automatically resize depending on the value being updated to.
  • Used the Push element to right justify your Convert button

My window looks very similar.

image

Here's the code for it:

import PySimpleGUI as sg

layout = [  [sg.Text(".acv file", s=10), sg.Input(key='ACV'), sg.FileBrowse(".acv")],
            [sg.Text("Preset Name", s=10), sg.Input(key='NAME')],
            [sg.Push(), sg.Button("Convert")],
            [sg.Text(key='OUT')]]

sg.Window("acv 2 xmp", layout).read(close=True)

It's not better, just different. The Push element makes centering and right justifying one or more elements pretty easy.

Thanks for the interesting program!

@DeusAres
Copy link
Owner

DeusAres commented Jan 8, 2022

Thanks to you for the amazing library you coded and your suggestion!

I wasn't aware of the new element, because I don't check often updates and documentation (my bad I know 😅), but I already see the potential of it, so I don't need to create a column every time I've to put the important button in the bottom right of the window.

Anyway I think columns are great in terms of labeling input fields and keeping the right distance But also fast to code for lazy programmers like me that don't want to set the text size, and when I'm unsure of the definitive labeling.

But your code is better it's better in terms of readability, you know, how Columns are structured

@PySimpleGUI
Copy link
Author

in terms of readability, you know, how Columns are structured

That's what made your solution so good. You used Columns in the way they're designed to work conceptionally. I have a difficult time viewing the window in that way which is why I cheated and added a size parameter to the Text element. You did it the right way that's the most flexible.

For centering and right justifying, it's hard to beat the Push element. It was only added in Sept 2021, so it has not yet gone mainstream.

image

There are only 2 demos that use it. I do cover it in the Udemy course and I see Jason using it more and more in the PySimpleGUI Issues.

image

Maybe I need to release a few demos showing its use as well as put it in the main cookbook.

You can see it in the eCookbook:

https://pysimplegui.trinket.io/demo-programs#/layouts/push-and-vpush-elements

Thank you for the kind words. Your fun is my fun.

image

@DeusAres
Copy link
Owner

DeusAres commented Jan 9, 2022

In my opinion, new updates should be announced through newsletters and social media. It would be awesome to open Instagram or Twittern and see a new update with visual aid, linking to the eCookBook

@PySimpleGUI
Copy link
Author

There's no shortage of ways to improve PySimpleGUI, that's certain. Ove r600 Issues are open on GitHub.

I closed the PySimpleGUI social media sites in December. They're not the right mechanism for me. The @PySimpleGUI twitter account was used heavily over the past 2 years to make announcements. A number of users said they don't have Tiwitter accounts. Social Mesia isn't a place for me.

Communication and documentation are always on the list of things being worked. I updated the docs yesterday in fact so it's a non-stop kind of activity.

Thanks for the suggestions. As with the previous 4 years, still going to keep working away at making PySimpleGUI better.

@PySimpleGUI
Copy link
Author

Control F is your friend with PySimpleGUI docs. I think I mention it in the docs. It's how I search them. I chose this method specifically for the simplicity.

@PySimpleGUI
Copy link
Author

Ooooo.... here's an idea you might find helpful.

The Annoumcenets Issue

Starting the month after the initial release, I began posting announcements in a GitHub issue:
PySimpleGUI/PySimpleGUI#142

Users that are following the project see the updates, but they also see a lot of other stuff that they may not be interested in.

image

Subscribing

You can "Subscribe" to this individual issue. Think of it as an "opt-in". GitHub will send you emails when there are changes.

This may be a mechanism worth mentioning at the top of the docs. I've never thought about it before.

If you go this route and find it useful, please let me know and I'll get the word out. I do want users to be informed or I wouldn't have posted over 1,000 of these announcements in the past few years. Every new release is announced there along with the release notes for that release.

@DeusAres
Copy link
Owner

DeusAres commented Jan 9, 2022

That is a pretty good idea. The only downside is that you need to load the entire page and scroll down to the bottom, it's a long page and for user with bad internet would take eternity (or maybe not with lazy loads, not sure about that). A reverse order showing or a page with a single comment that is created (to push the notification) and previous deleted (to keep it small) would be my way to go.

But definitely suggest it on the top of everywhere you can using bright colors and big headers for better noticing, might be redundant for some user but I think appreciated for users that didn't know yet and are not a one time user of this library

As I said in my Issue on the visibility of elements in columns, my way to go is Control F (text finder)

I also visited the twitter page, I think I can understand the problem, big effort, little rewards. It's more than frustrating. But probably not so many people knew there was a twitter. Your work deserves advertise, in a way or another, but more than that, it seems that you do a lot. Coding, solving github issues, updating cookbook, udemy course... Sometimes you have to delegate with projects this big. I'm sure that in the community someone skilled would be more than happy in running your social medias.

It's just an idea, pick it lightly, I'm writing without presumption because I don't know what's happening in the backstage or how the things are actually going

@PySimpleGUI
Copy link
Author

image

It's very evident you mean well. Thank you for the kind words.

@PySimpleGUI
Copy link
Author

PySimpleGUI commented Jan 11, 2022

Based on our conversation, I'm adding instructions in the documentation on how to subscribe to the PySimpleGUI GitHub Announcements issue. Thanks for taking some time to brainstorm with me. This is a well balanced approach and should work well, at least for the time being.

I just posted an issue to get the ball rolling here:
PySimpleGUI/PySimpleGUI#5084

Also based on this thread I've started working on a Cookbook entry for the Push element and a few other items that aren't yet documented well. Lots of documentation tweaks are underway.

@DeusAres
Copy link
Owner

I'm happy to contribute even a little. Also tried push elements, very clean way to center elements. In the next day I will post on the community tab another project I made.
Don't feel obligated to take a look, it's just that I suppose you may like to see new projects using your library

Also I don't know why, yesterday I took for granted that Update would have managed default_value of a Slider and discovered that was not implemented. That was a bit hard to discover.

Side note:
On bigger screens the call reference headers are unreadable, that is a font problem (helvetica I think).
Tried on chrome and edge:

image

@PySimpleGUI
Copy link
Author

Feel free to open issues on the PySimpleGUI GitHub page. http://Issues.PySimpleGUI.org It's the master list I work from and where all support is handled. Jason is a wizard 🧙‍♂️ that provides amazing support.

I've never heard this kind of problem reported that I can recall. Here's what it looks like for me and I have 3 large displays (3840x2160) measuring 43 inches and none of them have readability issues. Reporting it on GitHub will enable others to check to see if they have issues with it too.... also the Issue is how vital data is collected so that I'm not asking you a series of questions (what OS are you using, how big is your display, etc).

PySimpleGUI is far from perfect, that's for sure, but it steadily has gotten better thanks to users taking the time to report problems.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants