forked from PySimpleGUI/PySimpleGUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDemo_Emojis.py
More file actions
33 lines (25 loc) · 1.13 KB
/
Copy pathDemo_Emojis.py
File metadata and controls
33 lines (25 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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()