Refresh of ALL Demos in prep for 2.20 release
This commit is contained in:
parent
e251bf1bf4
commit
8b78d6e955
24 changed files with 330 additions and 144 deletions
|
@ -1,9 +1,7 @@
|
|||
import PySimpleGUI as gui
|
||||
|
||||
canvas = gui.Canvas(size=(100,100), background_color='red')
|
||||
|
||||
layout = [
|
||||
[canvas],
|
||||
[gui.Canvas(size=(100,100), background_color='red', key='canvas')],
|
||||
[gui.T('Change circle color to:'), gui.ReadFormButton('Red'), gui.ReadFormButton('Blue')]
|
||||
]
|
||||
|
||||
|
@ -11,12 +9,13 @@ form = gui.FlexForm('Canvas test')
|
|||
form.Layout(layout)
|
||||
form.ReadNonBlocking()
|
||||
|
||||
cir = canvas.TKCanvas.create_oval(50, 50, 100, 100)
|
||||
cir = form.FindElement('canvas').TKCanvas.create_oval(50, 50, 100, 100)
|
||||
|
||||
while True:
|
||||
button, values = form.Read()
|
||||
if button is None: break
|
||||
if button is None:
|
||||
break
|
||||
if button is 'Blue':
|
||||
canvas.TKCanvas.itemconfig(cir, fill = "Blue")
|
||||
form.FindElement('canvas').TKCanvas.itemconfig(cir, fill = "Blue")
|
||||
elif button is 'Red':
|
||||
canvas.TKCanvas.itemconfig(cir, fill = "Red")
|
||||
form.FindElement('canvas').TKCanvas.itemconfig(cir, fill = "Red")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue