O'Reilly logo

Kivy – Interactive Applications and Games in Python - Second Edition by Roberto Ulloa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Embedding layouts

Layouts are subclasses of widgets. We have already been embedding widgets inside widgets since the beginning (line 43) and it won't matter if the widgets we are embedding are also layouts. In this section, we will work with a comprehensive example to explore the effect of the position properties discussed in the previous section. The example is not visually appealing, but it will be useful to illustrate some concepts and to provide some code that you can use to test different properties. The following is the Python code (layouts.py) for the example:

92. # File name: layouts.py 93. from kivy.app import App 94. from kivy.uix.gridlayout import GridLayout 95. 96. class MyGridLayout(GridLayout): 97. pass 98. 99. class LayoutsApp(App): ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required