def counter(): text2.value = int(text2.value) + 1 #main body app = App(title="countdown conundrum", width=300, height=600) text = Text(app, grid=[50, 50]) waffle = Waffle(app, color="blue", align="bottom", command=scramble, height=5, pad=1, width=5, grid=[10, 10]) waffle.bg = "green" waffle.set_pixel(2, 2, "red") #button = PushButton(app, command=scramble, text="Start") combo = Combo(app, options=[ " ", "raspberry", "picademy", "codeclub", "coderdojo", "educator", "debugging", "process", "belfast", "boston", "foundation" ], command=compare, grid=[15, 20]) text2 = Text(app, text="1", grid=[25, 0]) text2.repeat(1000, counter) # Schedule call to counter() every 1000ms my_cat = Picture(app, image="download.jfif", grid=[5, 5]) app.display()
from guizero import App, Waffle, PushButton def clicked(x, y): waffle.set_pixel(x, y, "red") print("{}.{}".format(x, y)) print(waffle.get_all()) waffle.width = 5 waffle.height = 5 waffle.pixel_size = 50 waffle.dotty = True waffle.pad = 25 waffle.color = "green" app = App() waffle = Waffle(app, command=clicked, height=15, width=15) waffle.bg = (255, 255, 0) waffle.set_all("red") waffle.set_pixel(0, 0, "blue") waffle.set_pixel(8, 1, "#00ff00") waffle.set_pixel(3, 4, "blue") waffle.pixel(1, 2).dotty = True print(waffle[8, 1].color) button = PushButton(app, command=waffle.reset) app.display()