January 2015
Intermediate to advanced
282 pages
6h 12m
English
UI frameworks are mostly event-driven, and Kivy is no exception. The distinction from the "usual" procedural code is simple—the event-driven code needs to return to the main loop often; otherwise, it will be unable to process events from a user (such as pointer movement, clicks, or window resize), and the interface will "freeze". If you're a longtime Microsoft Windows user, you are probably familiar with programs that are unresponsive and freeze very often. It is crucial to never let this happen in our apps.
Practically, this means that we can't just code an infinite loop like this in our program:
# Don't do this
while True:
update_time() # some function that displays time
sleep(1)Technically, it might work, but the application's ...
Read now
Unlock full access