Skip to content

Commit d8c8ff1

Browse files
committed
Some updates
* Update README.md for forgotten link * Add "User Input Window" example Signed-off-by: Ercan Ersoy <ercanersoy@ercanersoy.net>
1 parent ddc54d7 commit d8c8ff1

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ These files licensed by MIT License.
1313
* [Rock Paper Scissors](rock-paper-scissors)
1414
* [Simple Calculator](simple-calculator)
1515
* [Simple Server](simple-server)
16+
* [Simple Window](simple-server-window)
1617
* [User Input](user-input)
18+
* [User Input Window](user-input-window)

user-input-window/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# User Input Window
2+
3+
An simple user input program with window
4+
5+
This example does not used a variable.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import PySimpleGUI as sg
2+
3+
sg.theme("SystemDefaultForReal")
4+
5+
layout = [[sg.Text("Input:"), sg.In(size=(50, 1), key="INPUT"), sg.Button("OK")]]
6+
7+
window = sg.Window("User Input Window", layout, element_justification="c",
8+
size=(500, 100), finalize=True)
9+
10+
while True:
11+
event, values = window.read()
12+
13+
if event == "OK":
14+
print(values["INPUT"])
15+
break
16+
17+
if event == sg.WIN_CLOSED:
18+
break
19+
20+
window.close()

0 commit comments

Comments
 (0)