2018-09-27 20:24:09 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
import sys
|
2018-09-28 18:57:37 +00:00
|
|
|
if sys.version_info[0] >= 3:
|
2018-09-27 20:24:09 +00:00
|
|
|
import PySimpleGUI as sg
|
2018-09-28 18:57:37 +00:00
|
|
|
else:
|
|
|
|
import PySimpleGUI27 as sg
|
2018-09-07 14:33:23 +00:00
|
|
|
|
2018-09-06 20:20:37 +00:00
|
|
|
"""
|
|
|
|
Turn off padding in order to get a really tight looking layout.
|
|
|
|
"""
|
2018-09-07 14:33:23 +00:00
|
|
|
|
2018-09-06 20:20:37 +00:00
|
|
|
sg.ChangeLookAndFeel('Dark')
|
|
|
|
sg.SetOptions(element_padding=(0, 0))
|
2018-10-15 20:07:23 +00:00
|
|
|
|
2018-09-06 20:20:37 +00:00
|
|
|
layout = [[sg.T('User:', pad=((3, 0), 0)), sg.OptionMenu(values=('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')],
|
2019-09-20 20:59:15 +00:00
|
|
|
[sg.Button('Start', button_color=('white', 'black')),
|
|
|
|
sg.Button('Stop', button_color=('gray50', 'black')),
|
|
|
|
sg.Button('Reset', button_color=('white', '#9B0023')),
|
|
|
|
sg.Button('Submit', button_color=('gray60', 'springgreen4')),
|
2018-09-24 22:01:00 +00:00
|
|
|
sg.Button('Exit', button_color=('white', '#00406B'))]]
|
2018-09-07 14:33:23 +00:00
|
|
|
|
2018-10-15 20:07:23 +00:00
|
|
|
window = sg.Window("Borderless Window",
|
|
|
|
default_element_size=(12, 1),
|
|
|
|
text_justification='r',
|
|
|
|
auto_size_text=False,
|
|
|
|
auto_size_buttons=False,
|
|
|
|
no_titlebar=True,
|
|
|
|
grab_anywhere=True,
|
2018-09-06 20:20:37 +00:00
|
|
|
default_button_element_size=(12, 1))
|
2018-09-07 14:33:23 +00:00
|
|
|
|
2018-09-24 22:01:00 +00:00
|
|
|
window.Layout(layout)
|
2018-09-07 14:33:23 +00:00
|
|
|
|
2018-09-06 20:20:37 +00:00
|
|
|
while True:
|
2018-10-15 20:07:23 +00:00
|
|
|
event, values = window.Read()
|
|
|
|
if event is None or event == 'Exit':
|
2018-09-06 20:20:37 +00:00
|
|
|
break
|
2018-09-06 15:08:06 +00:00
|
|
|
|
|
|
|
|