Follow up from Kivy class in .py and .kv interaction , but more complex.
Here is the full code of what I'm writing:
The data/screens/learnkanji_want.kv has how I want the code to be, but I don't fully understand how the class KanjiOriginScreen()
plays it's role in screen management.
data/screens/learnkanji.kv works how I want it, but for this to work I have to put keyb_height
in class KanjiOriginScreen()
(main.py). However I want that code to be in the class LayoutFunction()
(learnkanji.py).
Question
How can I put keyb_height
in the function LayoutFunction()
and access this in the .kv
file in <LayoutFunction>
?
Could you also explain why KanjiOriginScreen:
can be put in learnkanji.kv without < >
and the program still recognizes it should use this?
If anything is unclear, please ask :)
Edit
I found out that I didn't import the learnkanji.py in the learnkanji.kv file and that caused that it couldn't find the class 'LayoutFunction'.
#:import learnkanji data.screens.learnkanji