add callback function when showing a form on a notebook