I have a calendar button and a file browser button in a single window.
When a date is selected from the calendar, I want the date selected to show next to the button. When the user selects a file, I want the path to be shown in the input box. How can I accomplish this?
Here's my code:
import PySimpleGUI as sg
layout = [[sg.Text('Date to Start Summing')],
[sg.In(key='-CAL-', visible=False),
sg.CalendarButton('Calendar', target='-CAL-', pad=None, font=('MS Sans Serif', 10, 'bold'),
button_color=('red', 'white'), format='%m/%d/%Y')],
[sg.Text('Filename')],
[sg.In(key='-DIR-', visible=False),
sg.Input(size=(20, None)), sg.FileBrowse('Browse', target='-DIR-')],
[sg.OK(), sg.Cancel()]]
window = sg.Window('Data Collector', layout, grab_anywhere=False, size=(400, 280), return_keyboard_events=True,
finalize=True)
event, values = window.read()