Ejemplo n.º 1
0
          text_color='black',
          key='notes')
],
          [
              sg.T('Output:', pad=((3, 0), 0)),
              sg.T('', size=(44, 1), text_color='white', key='output')
          ],
          [
              sg.CBox('Checkbox:', default=True, pad=((3, 0), 0), key='cbox'),
              sg.Listbox((1, 2, 3, 4), size=(8, 3), key='listbox'),
              sg.Radio('Radio 1', default=True, group_id='1', key='radio1'),
              sg.Radio('Radio 2', default=False, group_id='1', key='radio2')
          ],
          [
              sg.Spin((1, 2, 3, 4), 1, key='spin'),
              sg.OptionMenu((1, 2, 3, 4), key='option'),
              sg.Combo(values=(1, 2, 3, 4), key='combo')
          ], [sg.Multiline('Multiline', size=(20, 3), key='multi')],
          [sg.Slider((1, 10), size=(20, 20), orientation='h', key='slider')],
          [
              sg.ReadButton('Enable', button_color=('white', 'black')),
              sg.ReadButton('Disable', button_color=('white', 'black')),
              sg.ReadButton('Reset',
                            button_color=('white', '#9B0023'),
                            key='reset'),
              sg.ReadButton('Values', button_color=('white', 'springgreen4')),
              sg.Button('Exit', button_color=('white', '#00406B'))
          ]]

window = sg.Window("Disable Elements Demo",
                   default_element_size=(12, 1),
Ejemplo n.º 2
0
if sys.version_info[0] < 3:
    import PySimpleGUI27 as sg
else:
    import PySimpleGUI as sg
"""
Demonstrates using a "tight" layout with a Dark theme.
Shows how button states can be controlled by a user application.  The program manages the disabled/enabled
states for buttons and changes the text color to show greyed-out (disabled) buttons
"""

sg.ChangeLookAndFeel('Dark')
sg.SetOptions(element_padding=(0, 0))

layout = [[
    sg.T('User:'******'User 1', 'User 2'), size=(20, 1)),
    sg.T('0', size=(8, 1))
],
          [
              sg.T('Customer:', pad=((3, 0), 0)),
              sg.OptionMenu(values=('Customer 1', 'Customer 2'), size=(20, 1)),
              sg.T('1', size=(8, 1))
          ],
          [
              sg.T('Notes:', pad=((3, 0), 0)),
              sg.In(size=(44, 1), background_color='white', text_color='black')
          ],
          [
              sg.ReadButton('Start',
                            button_color=('white', 'black'),
                            key='Start'),
Ejemplo n.º 3
0
#!/usr/bin/env python
import sys
if sys.version_info[0] < 3:
    import PySimpleGUI27 as sg
else:
    import PySimpleGUI as sg

"""
Turn off padding in order to get a really tight looking layout.
"""

sg.ChangeLookAndFeel('Dark')
sg.SetOptions(element_padding=(0, 0))
layout = [[sg.T('User:'******'User 1', 'User 2'), size=(20, 1)),
           sg.T('0', size=(8, 1))],
          [sg.T('Customer:', pad=((3, 0), 0)), sg.OptionMenu(values=('Customer 1', 'Customer 2'), size=(20, 1)),
           sg.T('1', size=(8, 1))],
          [sg.T('Notes:', pad=((3, 0), 0)), sg.In(size=(44, 1), background_color='white', text_color='black')],
          [sg.ReadButton('Start', button_color=('white', 'black')),
           sg.ReadButton('Stop', button_color=('gray50', 'black')),
           sg.ReadButton('Reset', button_color=('white', '#9B0023')),
           sg.ReadButton('Submit', button_color=('gray60', 'springgreen4')),
           sg.Button('Exit', button_color=('white', '#00406B'))]]

window = sg.Window("Time Tracker", default_element_size=(12, 1), text_justification='r', auto_size_text=False,
                   auto_size_buttons=False, no_titlebar=True,
                   default_button_element_size=(12, 1))

window.Layout(layout)

while True: