Dashboard
Dashboard copied to clipboard
Your overall GUI design / layout
Hiya! Big-time congrats on showing the Python community that tkinter can rock the GUIs if time is spent working on the design and polish.
Was there any other programs that you drew on for inspiration for your layout? I'm always on the lookout for nice layouts, like yours, so if you have run across other designs that inspired you to make this one, I would be interested in seeing those too.
Hi there! Thanks for the kind words! The layout for the GUI evolved as I worked on each widget. I originally had a much smaller GUI with more individual boxes but as I started to add images I soon realised the sizes would have to be amended to allow everything to fit in neat and tidy manner.
I used tkinter's .place for everything you see allowing me to draw boxes of specific sizes, I had to use a calculator a lot to get the spacing right and make sure each box had a nice uniform 20 pixel space around them.
I'm currently working out some new ideas for a new GUI dashboard, bigger and better! I would like to implement code to allow the form to automatically update periodically. I've experimented with this in the past and it's not straight forward in tkinter!
Totally understand the difficulties of working with tkinter to get just the right look. It's not easy with any of them to be honest. I'll give it a try with PySimpleGUI and see how it goes.
I think the updating part would be pretty easy with PySimpleGUI, but I guess that depends on what "updating" means.
In tkinter once you run mainloop the form is drawn and the program ends (it stays open until you decide to close it).
To get text or images to update within the form you can call update.after and specify an amount of time the program will wait before calling another function. To get the logic in the correct order can be a headache though!
I may have to look into learning PySimpleGUI if it's easier to implement a GUI that can update and change.
I'm familiar with the way the tkinter timers work 🙂 and the difficulty of working in an event driven environment. PySimpleGUI, the tkinter version, is a tkinter program basically so I kinda have to use tkinter.
PySimpleGUI can be trivial to use to update windows, but it depends on what kind of update you're trying to do. "Updating" a window by turned a bunch of checkboxes into radio buttons isn't an easy kind of update for PySimpleGUI. Modifying images, text, etc, is easy.
I'll give things a try to see if I can duplicate your layout. I'm pondering at the moment of how I want to create the borders. I think I've just about got it figured out but need to code up a few tests to see if the technique I'm thinking of will work.
I want to make a few "desktop widgets" that resemble parts of your dashboard anyway, so it'll just be an exercise of gluing them together to some extent. I don't have a drive space monitor for example. The weather stuff I've got done already, but want to see where / how you pulled graphics. I'm using OpenWeather I think. Here are a few of the other kinds of widgets I use. It looks like the weather one isn't posted in that repo but in the main PySimpleGUI Demos page instead. IT looks like this currently

Anyway, I'll let ya know how it goes.
OK, I think I've got the hang of how to do the kind of layout you've got going. Just have to fill in the bits.

Wow excellent work! :)
I'd love to check out the code when you finish!
Lemme clean stuff up a little and drop in a couple of blocks of info. It's about 40 lines of code at the moment with about 1/2 of it being that dummy things inside the blocks. I decided to remove the titlebar because on my windows machine it's white and looks like this as a result:

OK, I've posted my code so far here: https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_Dashboard.py
You'll need to download the PySimpleGUI.py file from the GitHub as I added a new Theme to match your color scheme. I could have done it a more manual way, but it was a good capability to have encapsulated.
This style of window I've not done before where there is padding used to create blocks with borders around them.
To do updates, you simply add the code in the while loop (the event loop).
Give it a try :-)
I updated the Demo_Dashboard.py file so that you don't need to install the PySimpleGUI.py file from GitHub.
You were talking about adding updating. To do that in PySimpleGUI, you add your code that processes button clicks, etc, into the "event loop" at the bottom of the demo. In that same loop you'll add updates to the sections of the dashboard that changed.
Here's the window creation and event loop for the demo at the moment:
window = sg.Window('Dashboard PySimpleGUI-Style', layout, margins=(0,0), background_color=BORDER_COLOR, no_titlebar=True, grab_anywhere=True)
while True: # Event Loop
event, values = window.read()
if event == sg.WIN_CLOSED or event == 'Exit':
break
window.close()