Separating with the screen manager
Its useful for a new app to have the opportunity to use more than one screen to organize our app content. These screens could be different from each other. The screen manager is the widget that permits this. In this recipe, we will develop an app that has two screens with different widgets in each one.
Getting ready
The readers must be aware and familiar with the concepts of the previous chapter as we use them to create this app. Particularly, the recipe Using Swappable Widgets in Chapter 4, Widgets.
How to do it…
We are going to create a KV code where we define and set the screen manager. Also, we will have a Python code where we will create the two screens that will be part of the screen manager. To complete the task, follow these steps:
- In the KV file, import the
screenmanager
package. - Define the rule for the root widget.
- Define
BoxLayout
for the buttons. - Define the
screenmanager
widget, with the property transition. - Define a new rule that controls the...