Hi,
So I have a situation where I am adding buttons in dynamically, the problem is I cant figure out how to set the “click” event on the dynamically created buttons.
So at the moment I have the buttons appearing but when they are clicked nothing happens.
I have searched and searched and found out how to dynamically add event handlers to them but I cant find out how to dynamically add a raise_event if they are clicked.
I tried calling a function at the time of creation to assign the raise event
for a in matched:
butt = Button(text=a)
self.flow_panel_10.add_component(butt)
def butt_click(self, **event_args):
self.raise_event(‘x-meds’)
but this does nothing.
What am I missing about assigning the click handler to the dynamically created button?
Thanks