Book Image

Kivy Blueprints

By : Vasilkov
Book Image

Kivy Blueprints

By: Vasilkov

Overview of this book

This book is intended for programmers who are comfortable with the Python language and who want to build desktop and mobile applications with rich GUI in Python with minimal hassle. Knowledge of Kivy is not strictly required—every aspect of the framework is described when it's first used.
Table of Contents (12 chapters)
10
A. The Python Ecosystem
11
Index

Screen manager

Let's begin the UI development with a new concept, namely screen management. Our application at hand, the chat client, is a fitting example. There will be two application states with different UI that are completely separate from one another:

  • The login screen where the user enters the hostname to connect to and the desired nickname:
    Screen manager
  • The chatroom screen, where the actual conversation takes place:
    Screen manager

Conceptually, these are the application states of the Chat app's frontend.

A straightforward approach to such UI separation will amount to managing the visible and hidden controls depending on some variable that holds the current desired UI state. This gets cumbersome very quickly as the number of widgets grow, and the boilerplate code isn't exactly fun to write anyway.

That's why the Kivy framework provides us with a container widget specifically tailored for the task, ScreenManager. Additionally, ScreenManager supports short animations to visualize the screen change...