Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

i expected this code to create a range of buttons on the displaying screen

from kivy.app import App

from kivy.uix.button import Button

from kivy.uix.stacklayout import StackLayout


class Stacklayout(StackLayout):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        for i in range(0, 10):
            b = Button(text="bruh", size_hint=(1, 1))
            self.add_widget(b)


class TheLabApp(App):
    pass


TheLabApp().run()

>Solution :

Your App does not have a build() method, so nothing is built and nothing is displayed.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Try modifying your App:

class TheLabApp(App):
    def build(self):
        return Stacklayout()
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading