Created
March 4, 2022 11:52
-
-
Save acbart/0c9a7fa464290d7505129022411b84e0 to your computer and use it in GitHub Desktop.
Example of GUIZero and Designer working together
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from guizero import * | |
| from designer import * | |
| # GuiZero stuff | |
| app = App(title="Main window", width=200, height=200) | |
| text_1 = Text(app, text="X", color="red", size=20) | |
| # Designer stuff | |
| frog = emoji("frog") | |
| grow(frog, 5) | |
| # Code to update GUIZero's display | |
| def handle_guizero(world): | |
| world['app'].update() | |
| when('updating', handle_guizero) | |
| # Initial world has the app and the frog | |
| start({ | |
| 'app': app, | |
| 'frog': frog | |
| }) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment