Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

How about some color? #9

@PySimpleGUI

Description

@PySimpleGUI

These are my opinions... they are subjective. Feel free to completely ignore them. I'm not sending them as a form of criticism. I'm blown away by what you've made. 💖 it! I hope you're as proud as you deserve to be.

I get that some of the recent trends, especially around windows 11 are all washed out, minimal. I'm not a fan. I like color. Among us is really colorful. There's maybe an opportunity for your application to pop. You've also got some cool graphics you can drop into it.

The recent psgcompiler uses the emojis as status.

image

When compiling it changes to this:

image

And once successful, it changes one more time.

image


A design tip....

If you want your combo's to all line up and be flush on the right side, add an sg.Push() element becore each of them in this screen:

image

[sg.Text('text'), sg.Combo()]

Becomes:

[sg.Text('text'), sg.Push(), sg.Combo()]

A time saver

There are a number of shortcuts or alias that can really cut down to the typing.

T = Text
I or In = Input
etc

You can also shorten the key and size parm.

Here is a list of the aliases for elements (not yet released in the docs)

Element Name Aliases tkinter Widget Description
Text T, Txt tk.Label One or more lines of Text
Input I, In, InputText tk.Entry Single line text input
Combo DD, Drop, DropDown, InputCombo
OptionMenu InputOptionMenu
Multiline ML, MLine
Output
Radio R, Rad
Checkbox CB, CBox, Check
Spin Sp
Button B, Btn
Image Im
Canvas
Column Col
Frame Fr
Tab
TabGroup
Pane
Graph G
Slider Sl
Listbox LB, LBox
Menu MenuBar, Menubar
MenubarCustom
ButtonMenu BM, BMenu
Titlebar
ProgressBar PBar, Prog, Progress
Table
Tree
VerticalSeparator VSep, VSeparator
HorizontalSeparator HSep, HSeparator
StatusBar SBar
Sizegrip SGrip
Push P, Stretch
VPush VP, VStretch
Sizer

Size and Key parms aliases

s = size
k = key

Also, for Text and Input elements, if you want the height to be 1, then you can use an int for the size rather than a tuple.

s=12 is the same as s=(12,1) or size=(12,1)


User Defined Elements

For big layouts like yours, if there is a pattern that repeats, I tend to make a function that returns the elements.

Something like this:

	[sg.Text('Times imposter:',key="timesimposter_display"),sg.Input(key="timesimposter",size=(10,None))],

Can be a function

def TxtIn(text, text_key, in_key, in_size)
	[sg.Text('text',key=text_ket),sg.Input(key=in_key,size=10)],

This gives you one place to change if you want to change the size of all of the input elements.
Your layout will be then be a series of these:

TxtIn('Times imposter:', timesimposter_display", "timesimposter",10)

💗 Seeing this!

		help_popup = sg.Window('About AUE',[
			[sg.T("Among Us Editor")],
			[sg.T(f"v{__version__}")],
			[sg.Text("By Vresod (Vresod#3907) on Discord")],
			[sg.Button("Close")]
		]).read(close=True)

image

That's getting into the groove of PySimpleGUI in a "really understanding the spirit of it" kind of way. Very tasty stuff!

image

Keep making stuff... you've got good instincts!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions