Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
678 B
3
Indexable
Never
from kivymd.uix.screen import MDScreen
from kivymd.app import MDApp
from kivymd.uix.button import MDFillRoundFlatButton
from kivymd.uix.boxlayout import MDBoxLayout

class ButtonIdApp(MDApp):
    def (self, args):
        self.text = self.id

    def build(self):

        self.screen = MDScreen()
        self.boxlayout = MDBoxLayout()
        for i in range(6):
            self.boxlayout.add_widget(MDFillRoundFlatButton(
                text = "button",
                self.id = str(i),
                on_press = self.changeButton
            ))

        self.screen.add_widget(self.boxlayout)
        return self.screen

if __name__ == '__main__':
    ButtonIdApp().run()