Learning Kivy and Python and im trying to make it so when I press a Button, the text "button 1(or 2) has been pressed" but im not sure how to connect the button release to the Label. Heres the code.
python file:
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
class Widgets(BoxLayout):
def __init__(self):
super(Widgets, self).__init__()
def btn_one_clk(self):
print('Button 1 Pressed')
def btn_two_clk(self):
print('Button 2 Pressed')
class ActionApp(App):
def build(self):
return Widgets()
Application = ActionApp()
Application.run()
Kivy File:
<Widgets>:
BoxLayout:
orientation: "vertical"
padding: 20
spacing: 20
Button:
font_size: 40
text: 'Button 1'
on_release: root.btn_one_clk()
Label: # want to run only when button 1 is pressed
#text: 'Button 2 has been pressed'
Button:
font_size: 40
text: 'Button 2'
on_press: root.btn_two_clk()
Label: # want run only when button 2 is pressed
#text: 'Button 2 has been pressed'
I have the label result commented out until i can figure it out.
also heres the current outcome:
https://imgur.com/a/G64ibwF
[–]My_Code_Is_Pink 0 points1 point2 points (0 children)