Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Kivy Blueprints
  • Toc
  • feedback
Kivy Blueprints

Kivy Blueprints

By : Vasilkov
3.7 (10)
close
Kivy Blueprints

Kivy Blueprints

3.7 (10)
By: Vasilkov

Overview of this book

This book is intended for programmers who are comfortable with the Python language and who want to build desktop and mobile applications with rich GUI in Python with minimal hassle. Knowledge of Kivy is not strictly required—every aspect of the framework is described when it's first used.
Table of Contents (12 chapters)
close
10
A. The Python Ecosystem
11
Index

Making tiles

This part of the chapter is devoted to building the Tile widget. Tiles are more dynamic in nature than, for example, the Board widget that we've seen earlier. To account for this, we are going to create a number of Kivy properties on the Tile class so that any visible change to tile automatically leads to redrawing it.

Kivy properties differ from regular Python ones: a property in Python is basically just a variable bound to an instance of class, possibly coupled with getter and setter functions. In Kivy, properties have an additional feature: they emit events when changed and as such you can observe interesting properties and adjust other related variables accordingly, or perhaps repaint the screen.

Most of this work happens under the hood without your intervention: when you issue a change to, for example, the pos or size of a widget, an event (on_pos or on_size respectively) is fired.

Interestingly, all properties that are defined in a .kv file are propagated automatically...

bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete