0

在 PySimpleGUI 中从窗口打开日历时,窗口默认位于屏幕的左上角。设置窗口的位置只会改变原始窗口,而不是弹出日历。有没有办法改变日历的位置?

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()
4

0 回答 0