August 2015
Intermediate to advanced
246 pages
4h 21m
English
GridLayout is the way to organize the child widgets in a table. In this recipe, we will organize four buttons in a 2x2 grid.
Again we will use the KV file to set the widgets and the Python file to set the layout. To complete the recipe:
<MyW>:
cols: 2
rows: 2
Button:
id: label1
text: 'B1'
Button:
id: label2
text: 'B2'
Button:
id: label3
text: 'B3'
Button:
id: label4
text: 'B4'GridLayout.GridLayout. Use the following code to do that:import kivy from kivy.app import App from kivy.uix.gridlayout import GridLayout class MyW(GridLayout): ...
Read now
Unlock full access