New CANVAS Demo, updated PNG Viewer Demo
This commit is contained in:
parent
e7c216dfe1
commit
ceafe787b2
2 changed files with 45 additions and 15 deletions
22
Demo_Canvas.py
Normal file
22
Demo_Canvas.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
import PySimpleGUI as gui
|
||||
|
||||
canvas = gui.Canvas(size=(100,100), background_color='red')
|
||||
|
||||
layout = [
|
||||
[canvas],
|
||||
[gui.T('Change circle color to:'), gui.ReadFormButton('Red'), gui.ReadFormButton('Blue')]
|
||||
]
|
||||
|
||||
form = gui.FlexForm('Canvas test')
|
||||
form.Layout(layout)
|
||||
form.ReadNonBlocking()
|
||||
|
||||
cir = canvas.TKCanvas.create_oval(50, 50, 100, 100)
|
||||
|
||||
while True:
|
||||
button, values = form.Read()
|
||||
if button is None: break
|
||||
if button is 'Blue':
|
||||
canvas.TKCanvas.itemconfig(cir, fill = "Blue")
|
||||
elif button is 'Red':
|
||||
canvas.TKCanvas.itemconfig(cir, fill = "Red")
|
Loading…
Add table
Add a link
Reference in a new issue