Files
2025_12_15_python/dzien_05/gui/gui01.py
2025-12-19 12:07:44 +01:00

32 lines
1.1 KiB
Python

import FreeSimpleGUI as sg
# sg.theme('DarkAmber') # Add a touch of color
# All the stuff inside your window.
layout = [ [sg.Text('Adam Jurkiewicz')],
[sg.Radio("Wybór A", "R01", default=True), sg.Radio("Wybór B", "R01")],
[sg.Text('Enter something on Row 2'), sg.InputText()],
[sg.Text('Enter something on Row XX'), sg.InputText()],
[sg.Button('Ok'), sg.Button('Przerwij'), sg.Button('HELP')] ]
# ZADANIE:
# dodaj przycisk o nazwie SYSTEM, wtedy na ekranie ma być
# print(sys.version)
# pamiętaj o imporcie sys ....
# Create the Window
window = sg.Window('Nasz super program', layout)
# Event Loop to process "events" and get the "values" of the inputs
while True:
event, values = window.read()
if event == sg.WIN_CLOSED or event == 'Przerwij': # if user closes window or clicks cancel
break
if event == 'HELP':
print("Pomoc dla ludu!!!")
plik = sg.popup_get_file('Please enter a file name')
sg.popup('Results', 'The value from PopupGetText', plik)
if event == "Ok":
print('You entered ', values[2], values[3])
print(f"{values=}")
window.close()