Butonda ki metni değiştirmek için tıkladığımda hata alıyorum.
Kod:
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.bubble import Bubble, BubbleButton
Builder.load_string("""
<main2>:
""")
class main2(Screen):
def b(self):
self.ids.btn.text = "B"
def a(self):
buton = BubbleButton(text = "A",id = "btn",
size_hint = (.3,.1),
pos_hint = {"x": .4, "y": .4})
self.add_widget(buton)
self.buton.bind(on_release = self.b)
sm = ScreenManager()
sm.add_widget(main2(name = "main2"))
class main(App):
def on_start(self):
self.app.a()
def build(self):
self.app = main2()
return self.app
if __name__ == '__main__':
main().run()