Skip to content
Advertisement

How to go to second page in kivymd python

I have the first page with login and perform checking on the .py file with database (sqlite3). Now the problem is how do I go to another page after perform the checking. Here I use the sm.windowManager but it does not work and give me a blank page. Is there anything can help me to go to other page on the .py file instead on the .kv file on_press

Here is the code:

JavaScript

Myapp.kv

JavaScript

Advertisement

Answer

The lines:

JavaScript

build your widget tree. However the lines in your kv file:

JavaScript

also build a widget tree (but without the required name properties for each Screen).

I recommend changing you kv to include the names:

JavaScript

And using that to build your widget tree in your App:

JavaScript

Note that naming your kv file as my.kv would allow it to be loaded automatically and you could eliminate the build() method entrely (see documentation). But that would required a change in your check() method.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement