2019-09-20 20:59:15 +00:00
|
|
|
import PySimpleGUI as sg
|
2018-08-06 03:17:42 +00:00
|
|
|
|
2020-05-07 10:22:59 +00:00
|
|
|
event, values = sg.Window('Window Title', [[sg.Text('Enter Something')], [sg.Input(key='-IN-'),],[sg.Button('OK'), sg.Button('Cancel')]]).read(close=True)
|
|
|
|
|
|
|
|
sg.popup(event, values)
|
|
|
|
|
|
|
|
|
2019-10-23 20:10:03 +00:00
|
|
|
# Basic Example
|
|
|
|
|
|
|
|
layout = [[sg.Text('Please enter your Name, Address, Phone')],
|
|
|
|
[sg.Text('Name', size=(10, 1)), sg.InputText(key='-NAME-')],
|
|
|
|
[sg.Text('Address', size=(10, 1)), sg.InputText(key='-ADDRESS-')],
|
|
|
|
[sg.Text('Phone', size=(10, 1)), sg.InputText(key='-PHONE-')],
|
|
|
|
[sg.Button('Submit'), sg.Button('Cancel')]]
|
2018-09-24 22:01:00 +00:00
|
|
|
|
2019-09-20 20:59:15 +00:00
|
|
|
window = sg.Window('Simple Data Entry Window', layout)
|
2020-05-07 10:22:59 +00:00
|
|
|
event, values = window.read(close=True)
|
2019-09-20 20:59:15 +00:00
|
|
|
print(event, values['-NAME-'], values['-ADDRESS-'], values['-PHONE-'])
|
2020-05-07 10:22:59 +00:00
|
|
|
sg.popup('test')
|
2019-10-23 20:10:03 +00:00
|
|
|
window.close()
|