Callback inside function

You could create an event dispatcher and call it when you want to send a callback. Then bind your widget event to the dispatcher.

Controller:

Widget: