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:
parent
2a06683383
commit
a1f4c60271
68 changed files with 706 additions and 1863 deletions
|
@ -3,18 +3,18 @@ import PySimpleGUI as sg
|
|||
|
||||
layout = [
|
||||
[sg.Canvas(size=(150, 150), background_color='red', key='canvas')],
|
||||
[sg.T('Change circle color to:'), sg.ReadFormButton('Red'), sg.ReadFormButton('Blue')]
|
||||
[sg.T('Change circle color to:'), sg.ReadButton('Red'), sg.ReadButton('Blue')]
|
||||
]
|
||||
|
||||
form = sg.FlexForm('Canvas test').Layout(layout).Finalize()
|
||||
window = sg.Window('Canvas test').Layout(layout).Finalize()
|
||||
|
||||
cir = form.FindElement('canvas').TKCanvas.create_oval(50, 50, 100, 100)
|
||||
cir = window.FindElement('canvas').TKCanvas.create_oval(50, 50, 100, 100)
|
||||
|
||||
while True:
|
||||
button, values = form.Read()
|
||||
button, values = window.Read()
|
||||
if button is None:
|
||||
break
|
||||
if button is 'Blue':
|
||||
form.FindElement('canvas').TKCanvas.itemconfig(cir, fill = "Blue")
|
||||
window.FindElement('canvas').TKCanvas.itemconfig(cir, fill = "Blue")
|
||||
elif button is 'Red':
|
||||
form.FindElement('canvas').TKCanvas.itemconfig(cir, fill = "Red")
|
||||
window.FindElement('canvas').TKCanvas.itemconfig(cir, fill = "Red")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue