From 6401ef34ddd7af95fb625f703254a70a6849ac0c Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Wed, 3 Mar 2021 16:07:08 -0500 Subject: [PATCH] New Demo with the PySimpleGUI Helpers --- DemoPrograms/Demo_Emojis.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 DemoPrograms/Demo_Emojis.py diff --git a/DemoPrograms/Demo_Emojis.py b/DemoPrograms/Demo_Emojis.py new file mode 100644 index 00000000..b354c4b7 --- /dev/null +++ b/DemoPrograms/Demo_Emojis.py @@ -0,0 +1,33 @@ +""" + Demo - the PySimpleGUI helpers (emojis) + + The list of characters available to you to use in your messages. + They are used internally when you get an error or as the icon for windows like + the SDK help window. + + Copyright 2021 PySimpleGUI +""" + + +import PySimpleGUI as sg + +layout = [[sg.Text('The PySimpleGUI Helpers', font='_ 20')], + [sg.Text('Sometimes frustrated or tired....', font='_ 15')], + [sg.Image(data=emoji) for emoji in sg.EMOJI_BASE64_SAD_LIST], + [sg.Text('But they are usually happy!', font='_ 15')], + [sg.Image(data=emoji) for emoji in sg.EMOJI_BASE64_HAPPY_LIST], + [sg.Button('Bad Key'), sg.Button('Hello'), sg.Button('Exit')] ] + +window = sg.Window('The PySimpleGUI Helpers', layout, icon=sg.EMOJI_BASE64_HAPPY_JOY, keep_on_top=True) + +while True: # Event Loop + event, values = window.read() + print(event, values) + if event == sg.WIN_CLOSED or event == 'Exit': + break + if event == 'Bad Key': + elem = window['-IM-'] + elif event == 'Hello': + sg.popup('Hi!', image=sg.EMOJI_BASE64_HAPPY_JOY, keep_on_top=True) + +window.close() \ No newline at end of file