Wrapper around :meth:`~.application.Application.register`.
        If :meth:`~.application.View.on` is called, for instance, during :meth:`~.application.View.build`,
        the event handlers will be enqueued and registered when the view is loaded. Similarly,
        if :meth:`~.application.View.on` is called once the view is loaded (for example, in a button callback),
        the event handler will be registered immediately.

        :param event: Name of the event to monitor
        :param callback: Callback function for when the event is received (Params: event, interface).
        :param selector: `(Optional)` CSS selector for the element(s) you want to monitor

def on(self, event, callback, selector=None):
        """
        Wrapper around :meth:`~.application.Application.register`.
        If :meth:`~.application.View.on` is called, for instance, during :meth:`~.application.View.build`,
        the event handlers will be enqueued and registered when the view is loaded. Similarly,
        if :meth:`~.application.View.on` is called once the view is loaded (for example, in a button callback),
        the event handler will be registered immediately.

        :param event: Name of the event to monitor
        :param callback: Callback function for when the event is received (Params: event, interface).
        :param selector: `(Optional)` CSS selector for the element(s) you want to monitor
        """
        cbk = asyncio.coroutine(callback)
        self._event_cache.append(
            {'event': event, 'callback': cbk, 'selector': selector})
        if self.is_loaded:
            self.context.register(event, cbk, selector)