Open PySimpleGUI opened 3 years ago
Wow! Thank you so much for this! I would be happy if anyone interacted with the project, let alone the creator of the library I use so often. I'm a very happy PySimpleGUI programmer today haha. I will add a GIF to the readme, I was a bit confused on how GitHub works but using github issues as a way to store images is something I will look into so thank you for that tip. Thanks for all the work you have done/continue to do on Py SG, it's been the biggest game changer in my programming journey.
Thank you very much Derik for the kind words! I'm glad you've been enjoying PySimpleGUI. FUN... that's the #1 goal after all.
I wrote a video on how to use GitHub to add images to your readme: https://youtu.be/C4PVKW756fo
Perfect. Thanks for help!
Sure! It's a lot of fun to see projects like yours. They're inspiring to me.
You might want to implement those 2 other buttons shown in the GIF....
ShareX makes GIFs that are super-small in size. I don't know how they do it: https://getsharex.com/
Haha I must admit it had been a minute since I looked at that project that when I posted that GIF I hadn't even noticed that those two extra buttons aren't mine! Thanks for the free feature ideas!
Heh... I thought it likely slipped past ya.
I rediscovered your project today!
I had forgotten you did this until I saw this issue.
While looking at the GIF, I realized the you could benefit from Right-Click menus perhaps. I've been using them quite a bit l lately for things like closing tabs. I could see them being quite useful for your nodes. You could right click and choose delete for example.... maybe.... I think....
Thanks for the application! Loved seeing this both the first time and this time!
@PySimpleGUI to be honest that idea never occurred to me but it seems like such an obvious choice...its intuitive and gets rid of the need for a ton of buttons to do that LOL. I wrote this application in JavaScript not too long ago and had to use JavaScript's version of PySimpleGUI's Graph element and it made me even more thankful for PySimpleGUI. The methods get_bounding_box, delete_figure, get_figures_at_location were lifesavers. Even the fact that I could set the origin in the bottom left corner instead of having the origin be in the top left was really helpful for wrapping my head around things. Thank you for handling the tough stuff for me with those methods :-)
It hadn't occurred to me either until when I looked at it, again, today.
You're quite welcome.... I do these things just as much for me as for you. I always struggle with where (0,0) is in every single graphics-oriented program I've ever written, so I figured if I could take away that pain, that little bit of annoyance, then it would be helpful.
I just finished recording the Graph element lesson for my Udemy course this past week. The get_figures call is fantastic! Of course, the reality is that tkinter provides that functionality... I just wrap it up in a nice present 🎁
This is the first example for the Graph Lesson
import PySimpleGUI as sg
data_points = [50, 10, 20, 80]
graph = sg.Graph((600, 600), (0, 0), (10, 100), k='-GRAPH-')
layout = [[graph], [sg.Button('Draw')]]
window = sg.Window('Graph Element - Example 1', layout)
while True:
event, values = window.read()
if event in (sg.WIN_CLOSED, 'Exit'):
break
for i, data in enumerate(data_points):
graph.draw_rectangle((i * 2 + 1, data), (i * 2 + 2, 0), fill_color='blue', line_width=2)
graph.draw_text(f' {data}', (i * 2 + 1, data + 2), font='_ 18')
It draws this labeled bar chart.
It's a whole 12 lines of code.
It could compress down to 10 easily
import PySimpleGUI as sg
data_points = [50, 10, 20, 80]
window = sg.Window('Graph Element - Example 1', [[sg.Graph((600, 600), (0, 0), (10, 100), k='-GRAPH-')], [sg.Button('Draw')]])
while True:
event, values = window.read()
if event in (sg.WIN_CLOSED, 'Exit'):
break
for i, data in enumerate(data_points):
window['-GRAPH-'].draw_rectangle((i * 2 + 1, data), (i * 2 + 2, 0), fill_color='blue', line_width=2)
window['-GRAPH-'].draw_text(f' {data}', (i * 2 + 1, data + 2), font='_ 18')
Glad you had a fun experience using PySimpleGUI.
@PySimpleGUI that label on top of the bar is the cherry on top, I love that example. I think the Graph object is a super important element to do justice because it is so easy to build cool things that you never would have had been able to imagine building as a python beginner but are super doable.
The first time I built something like that code you sent I was actually super proud of myself even though the problem solving aspect was simpler than some other command line programs I had built prior. Then you look at other people's PySimple code and get some more insights on the element and decide to go for the gusto and build your very first 'point moving along the screen' animation and you're ecstatic.
I still remember this project here and how much fun it was to make my very own animation type project.
I am super excited to checkout this Udemy course! It will be cool to learn a bunch of things I still don't know about PySimpleGUI...
Very nice!
I called the Graph Element the "Gateway Element" in the lesson 😀. With it, you can make your own elements pretty easily.
I showed several including a Gauge and a Dial element that Jason made
And 2 that an audio engineer made. These 2 blew me away when I saw them. He had never asked a question on GitHub. Out of nowhere screenshots showed up of a really impressive-looking application.
Changing the text color on your graph was a very nice touch!
It's fun to get to see what everyone is making. The audio engineer that created the custom sliders and VU meter isn't a software engineer / programmer by trade. I'm finding that if you give amateur programmers simple tools, they'll use them to make something much more complex on their own.
Hiya Derik!
I like what you've made. Can't say I've seen any PySimpleGUI program quite like it.
One thing I've learned over the past few years is that repos with a readme that has images of the GUI tend to get noticed and those that don't are often skipped over.
It's unusual for Python programs to have a GUI, so including a screenshot is an eye-grabber, to begin with.
You're quite clever in how you collected keyboard input using an Input Element, rather than enabling keyboard input in general, at the window level. I've not seen this done before either. Great stuff! I learn from users of all kinds and one of the reasons I like looking at projects from time to time.
Keep building stuff! You've got a unique approach.
Adding an image or a GIF to your readme is super simple if you use GitHub Issues to store your images. It's cheating, but it works great.