Summary
This chapter covered all the basics and introduced some not-so-basic concepts of Kivy. We covered how to configure classes, instances, and templates. Here is a list of Kivy elements we have learned to use in this chapter:
- Basic widgets –
Widget
,Button
,ToggleButton
, andLabel
- Layouts –
FloatLayout
,RelativeLayout
,BoxLayout
,GridLayout
,StackLayout
,AnchorLayout
, andPageLayout
- Properties –
pos
,x
,y
,center_x
,center_y
,top
,right
,size
,height
,width
,pos_hint
,size_hint
,group
,spacing
,padding
,color
,text
,font_size
,cols
,rows
,orientation
,anchor_x
, andanchor_y
- Variables –
self
androot
- Others –
id
and the markup tagssize
,color
,b
,i
, andsub
There are many more elements from the Kivy language that we can use, but with this chapter, we have understood the general idea of how to organize elements. With the help of the Kivy API, we should be able to display most of the elements available for GUI design. There is, however, a very important element we need to study separately – the canvas
, which allows us to draw vector shapes inside widgets, such as the white rectangle we draw as background in the PageLayout
example. It is a very important topic to master in Kivy, and the entire next chapter, Graphics - The Canvas, will be dedicated to it.