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 kivy.core.window import Window
from kivy.lang import Builder
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.image import Image
from kivymd.app import MDApp
KV = """
MDFloatLayout:
Carousel:
MDFloatLayout:
id : slide
MDTextField:
hint_text: "First Name"
size_hint_x: 0.5
icon_right: "account"
pos_hint:{"center_x":0.5,"center_y":0.5}
font_style: "H6"
text_color: "Custom"
MDTextField:
hint_text: "Last Name"
size_hint_x: 0.5
icon_right: "account"
pos_hint:{"center_x":0.5,"center_y":0.4}
MDRaisedButton:
text:"NEXT"
size_hint_x:0.2
pos_hint: {"center_x":0.5,"center_y":0.2}
on_release: app.next()
"""
class Jeu(FloatLayout):
def debut(self):
self.size = Window.size
self.add_widget(Image(source='w2.jpg', allow_stretch=True, keep_ratio=False))
class ViTVApp(MDApp):
def build(self):
kv1 = Builder.load_string(KV)
kv = Jeu()
img = Image(source="1611647504798.png",
size_hint_y=0.15, size_hint_x=0.15, pos_hint={'center_x': 0.5, 'center_y': 0.85}, opacity=0.8)
kv.debut()
kv.add_widget(img)
kv.add_widget(kv1)
return kv
def next(self):
self.root.ids.slide.ids.carousel.load_next(mode="next")
if __name__ == "__main__":
ViTVApp().run()
The console repeatedly gives this error, but the window pops up just fine:
File "", line 30, in File "E:\Developpement\ViTV\P1\P3.py", line 64, in next self.root.ids.slide.ids.carousel.load_next(mode="next") File "kivy\properties.pyx", line 864, in kivy.properties.ObservableDict.getattr AttributeError: 'super' object has no attribute 'getattr'