I am using a CalendarButton to get a date - no big deal. I have set it's location in the initial layout - also no probs. I am getting the window's location with window_loc = window.CurrentLocation()
What I want to do is change the location of the popup calendar to stay with the main window when it is dragged around the screen. I have tried the window.update route but get an error message Exception has occurred: TypeError update() got an unexpected keyword argument 'location' Is it possible to do this?? Any help appreciated
Tried the code supplied in answer & got
Exception has occurred: TypeError popup_get_date() got an unexpected keyword argument 'relative_location'
Not sure why
Update - solved using code:
elif event == 'Date':
main_window_location = window.CurrentLocation()
chosen_mon_day_year = sg.popup_get_date(location=
(main_window_location))
if chosen_mon_day_year:
window['-IN-'].update(chosen_mon_day_year)
I get the popup to be where I want - with the main window.
Thanks