Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How to make a login page in kivy?


Asked by Frankie Perez on Dec 06, 2021 FAQ



To make the Login page, we first have to import some features of kivy – widgets, gridlayout. In this class, we made the grids and the blocks like username, password and provide the fuctionality of text input.
Subsequently,
When you are creating a screen, you absolutely need to give a name to it: from kivy.uix.screenmanager import ScreenManager, Screen # Create the manager sm = ScreenManager() # Add few screens for i in range(4): screen = Screen(name='Title %d' % i) sm.add_widget(screen) # By default, the first screen added into the ScreenManager will be # displayed.
Moreover, To create a button, import button instead of a label as follows: from kivy.app import App from kivy.uix.button import Button class FirstKivy (App): def build (self): return Button (text="Welcome to LikeGeeks!") FirstKivy ().run ()
Indeed,
Kivy is a multiplatform GUI library, known for being responsive. It provides management of multiple screens in a single application. In this application we will be using multiple screens to log in user’s info and validate it.
Accordingly,
To create a Kivy interface, we first need to import the Kivy app module in our program using the following statement: Now importing label from kivy.uix.label: Now is the time to write our main program. class FirstKivy (App): def build (self): return Label (text="Hello Kivy!") In the above snippet, a class is inherited from the App class.