August 2015
Intermediate to advanced
246 pages
4h 21m
English
Now, we are going to introduce another layout widget named BoxLayout. Its name is a reference to the heap boxes where the boxes are the child widgets. To illustrate this, we will make a vertical heap of three buttons in this recipe.
You should be familiar with the widget tree abstraction, and it is important to check the recipes about the tree in this chapter.
We will need a KV file to set BoxLayout and a Python file to add the BoxLayout widget to our app. Follow the next steps:
BoxLayout widget and set the size_hint and orientation properties.BoxLayout:<MyW>: BoxLayout: size_hint: 0.5,0.5 orientation: 'vertical' Button: id: label1 text: 'B1' Button: id: label2 ...
Read now
Unlock full access