Exemplo n.º 1
0
def main():
    layout = [[sg.Text('This is a text element')], [
        sg.Input()
    ], [
        sg.Combo(['Combo 1'])
    ], [sg.Text('If you close the browser tab, the app will exit gracefully')],
              [sg.InputText('Source')], [sg.InputText('Dest')],
              [sg.Ok(), sg.Cancel()]]

    window = sg.Window('Demo window..', layout)
    i = 0
    while True:
        event, values = window.read(timeout=1)
        if event != sg.TIMEOUT_KEY:
            print(event, values)
        if event is None:
            break
        i += 1
    window.close()
Exemplo n.º 2
0
                      size=(5, 20),
                      default_value=75),
            sg.Slider(range=(1, 100),
                      orientation='v',
                      size=(5, 20),
                      default_value=10),
            sg.Column(column1, background_color='#F7F3EC')
        ]])
    ], [sg.Text('_' * 80)], [sg.Text('Choose A Folder', size=(35, 1))],
    [
        sg.Text('Your Folder',
                size=(15, 1),
                auto_size_text=False,
                justification='right'),
        sg.InputText('Default Folder'),
        sg.FolderBrowse()
    ], [sg.Submit(tooltip='Click to submit this window'),
        sg.Cancel()]
]

window = sg.Window('Everything bagel',
                   layout,
                   default_element_size=(40, 1),
                   grab_anywhere=False)

event, values = window.read()

window.close()

sg.popup('Title', 'The results of the window.',
         'The button clicked was "{}"'.format(event), 'The values are', values)