Kivy outside rule inherence

前端 未结 1 1393
闹比i
闹比i 2021-01-25 04:51

I want to specify a special button so I don\'t have to adjust every button I use, however I want it\'s event to trigger a function in a different class.

main.py

         


        
相关标签:
1条回答
  • 2021-01-25 05:20

    Change the kv to this

    <FancyButton>:
        on_release: self.imp.NoInspiration(':)')
    
    
    <Important>:
        id: imp
    
        BoxLayout:
            FancyButton:
                text: "smiley"
                imp: root
    
    BoxLayout:
        Important
    
    0 讨论(0)
提交回复
热议问题