官术网_书友最值得收藏!

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, and Label
  • Layouts – FloatLayout, RelativeLayout, BoxLayout, GridLayout, StackLayout, AnchorLayout, and PageLayout
  • 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, and anchor_y
  • Variables – self and root
  • Others – id and the markup tags size, color, b, i, and sub

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.

主站蜘蛛池模板: 宿松县| 石台县| 辉南县| 马关县| 井研县| 靖安县| 湄潭县| 兴城市| 漾濞| 绥宁县| 怀柔区| 大渡口区| 苍山县| 香港 | 密山市| 奉贤区| 息烽县| 策勒县| 乐安县| 桃源县| 慈利县| 柘城县| 贡嘎县| 且末县| 女性| 海城市| 清丰县| 龙州县| 广东省| 太谷县| 鄂尔多斯市| 潮安县| 宁城县| 长治市| 安国市| 繁峙县| 尚义县| 栾城县| 鄂温| 碌曲县| 旬邑县|