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

@ -74,17 +74,15 @@ def draw(fig, canvas):
def main():
global g_my_globals
canvas_elem = sg.Canvas(size=(640, 480)) # get the canvas we'll be drawing on
# define the form layout
layout = [[sg.Text('Animated Ping', size=(40, 1), justification='center', font='Helvetica 20')],
[canvas_elem],
[sg.ReadFormButton('Exit', size=(10, 2), pad=((280, 0), 3), font='Helvetica 14')]]
[sg.Canvas(size=(640, 480), key='canvas')],
[sg.ReadButton('Exit', size=(10, 2), pad=((280, 0), 3), font='Helvetica 14')]]
# create the form and show it without the plot
form = sg.FlexForm('Demo Application - Embedding Matplotlib In PySimpleGUI')
form.Layout(layout)
form.Finalize()
window = sg.Window('Demo Application - Embedding Matplotlib In PySimpleGUI').Layout(layout).Finalize()
canvas_elem = window.FindElement('canvas')
canvas = canvas_elem.TKCanvas
fig = plt.figure()
@ -93,7 +91,7 @@ def main():
plt.tight_layout()
while True:
button, values = form.ReadNonBlocking()
button, values = window.ReadNonBlocking()
if button is 'Exit' or values is None:
break