Kivy outside rule inherence

前端 未结 1 1392
闹比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

    :
        on_release: self.imp.NoInspiration(':)')
    
    
    :
        id: imp
    
        BoxLayout:
            FancyButton:
                text: "smiley"
                imp: root
    
    BoxLayout:
        Important
    

    0 讨论(0)
提交回复
热议问题