Open get title and get date windows at same location as the main window

This commit is contained in:
PySimpleGUI 2021-03-18 21:34:19 -04:00
parent 799ce7c9c1
commit 88ed763023
1 changed files with 2 additions and 2 deletions

View File

@ -99,12 +99,12 @@ def main(location):
if event == 'Edit Me':
sg.execute_editor(__file__)
elif event == 'Choose Date':
new_start = sg.popup_get_date()
new_start = sg.popup_get_date(location=window.current_location())
if new_start is not None:
start_date = datetime.datetime(new_start[2], new_start[0], new_start[1])
sg.user_settings_set_entry('-start date-', new_start)
elif event == 'Choose Title':
new_title = sg.popup_get_text('Choose a title for your date')
new_title = sg.popup_get_text('Choose a title for your date', location=window.current_location())
if new_title is not None:
window['-TITLE-'].update(new_title)
sg.user_settings_set_entry('-title-', new_title)