How to invoke call of method of Widget(Back End) from View(Front End)

Hello, I am trying to make a custom widget in which
when I click a button widget, this will somehow (send a signal maybe?) have a function in python code of Widget get called.

I get it that trailtlets let any widgets sync their attributes over to front-end models,
but how do I may this work the opposite way?

If you are talk specifically about a Button, this is already supported.

You’d have your click do whatever you need to another widget.

Another alternative is ipyevents which provides fine-grained access to many dom events for any widget.

If you want to do this for a new, custom widget, you’d want to look at how the backend and frontend work for button:

2 Likes