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
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.
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!
discussion