The layouts studied in the previous section are subclasses of
Widget. We have already been embedding widgets inside widgets since the beginning of this chapter and, of course, it won't matter if the widgets we are embedding are layouts as well. The following Python code is the base of a comprehensive example about embedding
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): 100. def build(self): 101. return MyGridLayout() 102. 103. if __name__=="__main__": 104. LayoutsApp().run()
There's nothing new in the preceding code, we just implemented the
MyGridLayout class. The final result is shown ...