From f8e8cd89f04cfb4b457f11e0b5b3fadcede437a0 Mon Sep 17 00:00:00 2001 From: Adam Jurkiewicz Pythonista Local Date: Fri, 19 Dec 2025 12:21:33 +0100 Subject: [PATCH] g --- dzien_05/gui/gui01.py | 2 +- dzien_05/gui/gui02.py | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 dzien_05/gui/gui02.py diff --git a/dzien_05/gui/gui01.py b/dzien_05/gui/gui01.py index 1d4cbbb..9f07294 100644 --- a/dzien_05/gui/gui01.py +++ b/dzien_05/gui/gui01.py @@ -2,7 +2,7 @@ import FreeSimpleGUI as sg # sg.theme('DarkAmber') # Add a touch of color # All the stuff inside your window. -layout = [ [sg.Text('Adam Jurkiewicz')], +layout = [ [sg.Text('Wybrana data'), sg.In(key='data') ,sg.CalendarButton("Wskaż datę", target='data')], [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()], diff --git a/dzien_05/gui/gui02.py b/dzien_05/gui/gui02.py new file mode 100644 index 0000000..bad22c7 --- /dev/null +++ b/dzien_05/gui/gui02.py @@ -0,0 +1,33 @@ +import FreeSimpleGUI as sg + +# sg.theme('DarkAmber') # Add a touch of color +# All the stuff inside your window. +layout = [ [sg.Text('Wybrana data'), sg.In(key='data') ,sg.CalendarButton("Data", target='data')], + [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.Text('Wybrany plik'), sg.In(key='input'), sg.FileBrowse(target='input')], + [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() \ No newline at end of file