Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Help my button event is not working #6

Open
JohnnyAidoo opened this issue Jun 16, 2022 · 0 comments
Open

Help my button event is not working #6

JohnnyAidoo opened this issue Jun 16, 2022 · 0 comments

Comments

@JohnnyAidoo
Copy link

import kivy

from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.floatlayout import FloatLayout

class layout(FloatLayout):
def init (self, **kwargs):
super(). init(**kwargs)

    b1 = Button(
    text = 'press me',
    pos_hint ={'x': 0.2 , 'y': 0.1},
    size_hint = (0.2, 0.1),
    )
    b1.bind(on_pressed =self.pressed)
    
    
    l1= Label(
    text = 'i am a label',
    color =(1,0,0,1)
    )
    self.add_widget(b1)
    self.add_widget(l1)
    
    
        
def pressed(self, elem):
    b1.text ='hiiiii'

class myApp(App):
def build(self):
return layout()

myApp().run()

@JohnnyAidoo JohnnyAidoo changed the title Help Help my button event is not working Jun 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant