August 2015
Intermediate to advanced
246 pages
4h 21m
English
Sometimes, it is necessary to access or reference other widgets in a specific widget tree. In the Kv language, there is a way to do it using IDs.
This recipe will use two common widgets just for reference. The Button and TextInput fields are very common widgets.
This recipe is as follows:
<MyWidget>:
Button:
id: f_but
TextInput:
text: f_but.state Let's see the code; this is the first line:
<MyWidget>:
This is the name of the widget we will use, which is a clickable text input. The second line is:
Button:
This defines the button. The third line is:
id: f_but
This gives the button an ID of f_but, which we will use to reference the button. The fourth line ...
Read now
Unlock full access