Element callback update #345
Replies: 3 comments 9 replies
-
can somebody help me to achieve this ? |
Beta Was this translation helpful? Give feedback.
-
Why would you like to do this? You can register a callback function to the button and then inside the function decide what to do. Why change the callback itself? Otherwise each element has a list |
Beta Was this translation helpful? Give feedback.
-
so I'm trying the example you gave me b = ui.button('Click')
ui.button('Add callback', on_click=lambda: b.on('click', lambda: ui.notify('Clicked!'))) I noticed now it create another button with text 'Add callback' that I have to click on it first to make b button work. |
Beta Was this translation helpful? Give feedback.
-
Hello,
Is it possible to add set_callback method to elements such as button so we can change or add the callback later ?
thanks
Beta Was this translation helpful? Give feedback.
All reactions