Skip to content

Updating TextInput on switch/button on_toggle & off_toggle #1518

Answered by freakboy3742
AnkS4 asked this question in Q&A
Discussion options

You must be logged in to vote

The update behavior you're seeing needs a little explanation, but it comes down to "When are you giving the GUI toolkit an opportunity to update itself?" You're not - and as a result, the widget isn't updating.

You may have noticed that you start an app by invoking a main_loop() method - that main loop is the event loop. It's essentially a tight loop that say "while App Running: redraw app" (it's a little more complex than that in practice, but it's close enough for this explanation). When you're not interacting with it, the app is constantly redrawing in the background; whenever an event occurs (like a button click), your handler is queued into the event loop for execution. However, the …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@AnkS4
Comment options

@freakboy3742
Comment options

Answer selected by AnkS4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants