2020-06-22 08:28:29 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
import sys
|
2019-10-23 20:10:03 +00:00
|
|
|
import PySimpleGUI as sg
|
|
|
|
|
2020-06-22 08:28:29 +00:00
|
|
|
if not sys.platform.startswith('win'):
|
|
|
|
sg.popup_error('Sorry, you gotta be on Windows')
|
|
|
|
sys.exit()
|
|
|
|
import winsound
|
2018-09-27 20:24:09 +00:00
|
|
|
|
2020-06-22 08:28:29 +00:00
|
|
|
layout = [
|
|
|
|
[sg.Button('Start', button_color=('white', 'black'), key='start'),
|
|
|
|
sg.Button('Stop', button_color=('white', 'black'), key='stop'),
|
|
|
|
sg.Button('Reset', button_color=('white', 'firebrick3'), key='reset'),
|
|
|
|
sg.Button('Submit', button_color=('white', 'springgreen4'), key='submit')]
|
|
|
|
]
|
2018-09-14 16:17:19 +00:00
|
|
|
|
2020-06-22 08:28:29 +00:00
|
|
|
window = sg.Window("Button Click", layout, auto_size_buttons=False, default_button_element_size=(12,1), use_default_focus=False, finalize=True)
|
2018-09-14 16:17:19 +00:00
|
|
|
|
2020-06-22 08:28:29 +00:00
|
|
|
window['submit'].update(disabled=True)
|
2019-12-24 23:52:47 +00:00
|
|
|
|
2020-06-22 08:28:29 +00:00
|
|
|
recording = have_data = False
|
|
|
|
while True:
|
|
|
|
event, values = window.read(timeout=100)
|
|
|
|
if event == sg.WINDOW_CLOSED:
|
|
|
|
break
|
|
|
|
winsound.PlaySound("ButtonClick.wav", 1) if event != sg.TIMEOUT_KEY else None
|
2019-10-23 20:10:03 +00:00
|
|
|
window.close()
|