I'm just learning, and I tried to run this simple code :
ihave a problem , can we help me :
this is my code for my apps:
from kivymd.app import MDApp
from kivy.lang.builder import Builder
from kivy.uix.screenmanager import ScreenManager, Screen
Screen_helper = """
ScreenManager:
MenuScreen:
InscriptionScreen:
LoginScreen:
<MenuScreen>:
name: 'menu'
MDRectangleFlatButton:
text: 'Inscription'
pos_hint: {'center_x':0.5,'center_y':0.6}
on_press: root.manager.current = 'Inscription'
MDRectangleFlatButton:
text: 'Login'
pos_hint: {'center_x':0.5,'center_y':0.5}
on_press: root.manager.current = 'Login'
<InscriptionScreen>:
name: 'Inscription'
MDLabel:
text: "Inscription"
pos_hint: {"center_y": .85}
font_style:"H4"
halign : "center"
theme_text_color : "Custom"
text_color : 0, 0, 0, 1
MDTextField:
hint_text: "Enter First Name"
icon_right:"account"
pos_hint:{'center_x':0.5,'center_y':0.7}
size_hint_x:None
width:300
MDTextField:
hint_text: "Enter Last Name"
icon_right : "account"
pos_hint:{'center_x':0.5,'center_y':0.6}
size_hint_x:None
width:300
MDTextField:
hint_text: "Enter Email"
icon_right: "mail"
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
size_hint_x: None
width: 300
MDTextField:
hint_text: "Enter Username"
icon_right:"account-plus"
pos_hint:{'center_x':0.5,'center_y':0.4}
size_hint_x:None
width:300
MDTextField:
hint_text: "Enter Password"
icon_right:"lock"
pos_hint:{'center_x':0.5,'center_y':0.3}
size_hint_x:None
width:300
password: True
MDTextField:
hint_text: "Confirm Password"
icon_right:"lock"
pos_hint:{'center_x':0.5,'center_y':0.2}
size_hint_x:None
width:300
password: True
MDRaisedButton:
text:"Valider"
font_style:"H4"
type: 'bottom'
pos_hint: {'center_x':0.5,'center_y':0.08}
size_hint_x: 0.5
MDRectangleFlatButton:
text: ' re'
icon:"keyboard-return"
pos_hint: {'center_x':0.1,'center_y':0.9}
on_press: root.manager.current = 'menu'
type : 'Detour'
<LoginScreen>:
name: 'Login'
MDLabel:
text: "Login"
pos_hint: {"center_y": .85}
font_style:"H4"
halign : "center"
theme_text_color : "Custom"
MDTextField:
hint_text: "Username"
icon_right:"account"
pos_hint:{'center_x':0.5,'center_y':0.7}
size_hint_x:None
width:300
MDTextField:
hint_text: "Password"
icon_right : "lock"
pos_hint:{'center_x':0.5,'center_y':0.6}
size_hint_x:None
width:300
password : True
MDRaisedButton:
text:"Log in"
pos_hint: {'center_x':0.5,'center_y':0.4}
size_hint_x: 0.5
MDRectangleFlatButton:
text: 'Back'
pos_hint: {'center_x':0.9,'center_y':0.1}
on_press: root.manager.current = 'menu'
"""
class MenuScreen(Screen):
pass
class InscriptionScreen(Screen):
pass
class LoginScreen(Screen):
pass
# Create the screen manager
sm = ScreenManager()
sm.add_widget(MenuScreen(name="menu"))
sm.add_widget(InscriptionScreen(name="Inscription"))
sm.add_widget(LoginScreen(name="Login"))
class DemoApp(MDApp):
def build(self):
screen = Builder.load_string(Screen_helper)
return screen
DemoApp().run()
The console repeatedly gives this error, but the window pops up just fine:
[CRITICAL ] [Clock ] Warning, too much iteration done before the next frame. Check your code, or increase the Clock.max_iteration attribute
question from:
https://stackoverflow.com/questions/65872131/critical-clock-warning-too-much-iteration-done-before-the-next-frame 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…