Major demo refresh.. switched everything to new function names, new design patterns

Out with the old, in with the new!!
This commit is contained in:
MikeTheWatchGuy 2018-09-24 18:01:00 -04:00
parent 2a06683383
commit a1f4c60271
68 changed files with 706 additions and 1863 deletions

View file

@ -36,10 +36,10 @@ def main():
layout = [ [sg.Quit( button_color=('white','black')), sg.T('', pad=((100,0),0), font='Any 15', key='output')],
[sg.Graph(CANVAS_SIZE, (0,0), (SAMPLES,SAMPLE_MAX),background_color='black', key='graph')],]
form = sg.FlexForm('CPU Graph', grab_anywhere=True, keep_on_top=True, background_color='black', no_titlebar=True, use_default_focus=False).Layout(layout)
window = sg.Window('CPU Graph', grab_anywhere=True, keep_on_top=True, background_color='black', no_titlebar=True, use_default_focus=False).Layout(layout)
graph = form.FindElement('graph')
output = form.FindElement('output')
graph = window.FindElement('graph')
output = window.FindElement('output')
# start cpu measurement thread
thread = Thread(target=CPU_thread,args=(None,))
thread.start()
@ -48,7 +48,7 @@ def main():
prev_x, prev_y = 0, 0
while True: # the Event Loop
time.sleep(.5)
button, values = form.ReadNonBlocking()
button, values = window.ReadNonBlocking()
if button == 'Quit' or values is None: # always give ths user a way out
break
# do CPU measurement and graph it
@ -69,4 +69,3 @@ def main():
if __name__ == '__main__':
main()
exit(69)