Ive already came across with some other questions similar to this one and none could help at all. I just installed Kivy through pip install (only use a single venv) and I made two simple example-boxes via python and they did worked in VScode. Then an issue starts as I try to use kv language. It turns out that nothing happens, that is, my app runs and a black window is the only thing.
import kivy
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
class Action(BoxLayout):
def sum(self):
self.ids.lb.text =str(int(self.ids['lb'].text) 1)
class box(App):
def build(self):
return Action()
if __name__=='__main__':
box().run()
The kivy seems to be properly installed because I had already ran a python code (boxLayout) once before. The main difficulty is to get Vscode to recognize the kv file, and I couldnt find it nowhere else yet. Thank u all in advance, and also I attach here the kv. code that interacts with the py one.
CodePudding user response:
You need to ensure that you are following the correct conventions.
Clicking the button increases the value in the label.