From f0f4dcb92e01eda60491d8dccb1328537992113e Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Sat, 14 Sep 2019 20:25:17 -0400 Subject: [PATCH] New demo program to enable you to quickly test out the different look and feel settings --- .../Demo_Change_Look_And_Feel_Browser.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 DemoPrograms/Demo_Change_Look_And_Feel_Browser.py diff --git a/DemoPrograms/Demo_Change_Look_And_Feel_Browser.py b/DemoPrograms/Demo_Change_Look_And_Feel_Browser.py new file mode 100644 index 00000000..823e66f5 --- /dev/null +++ b/DemoPrograms/Demo_Change_Look_And_Feel_Browser.py @@ -0,0 +1,25 @@ +import PySimpleGUI as sg + +""" + Allows you to "browse" through the look and feel settings. Click on one and you'll see a + Popup window using the color scheme you chose. It's a simply little program that demonstrates + how snappy a GUI can feel if you enable an element's events rather than waiting on a button click. + In this program, as soon as a listbox entry is clicked, the read returns. +""" + +sg.ChangeLookAndFeel('GreenTan') + +layout = [ [sg.Text('Look and Feel Browser')], + [sg.Text('Click a look and feel color to see demo window')], + [sg.Listbox(values=sg.list_of_look_and_feel_values(), size=(20,12), key='-LIST-', enable_events=True)], + [sg.Button('Show Window'), sg.Button('Exit')] ] + +window = sg.Window('Look and Feel Browser', layout) + +while True: # Event Loop + event, values = window.read() + if event in (None, 'Exit'): + break + sg.change_look_and_feel(values['-LIST-'][0]) + sg.popup_get_text('This is {}'.format(values['-LIST-'][0])) +window.close()