I think it's a simple problem but I didn't found the right function on the doc or on stackoverflow posts.
from kivymd.app import MDApp
from kivy.lang import Builder
KV = '''
BoxLayout:
MDIcon:
halign: "center"
icon: "language-python"
'''
class TestApp(MDApp):
def build(self):
return Builder.load_string(KV)
def on_icon_click(self, widget):
print("someone clicked on me")
if __name__ == '__main__':
TestApp().run()