$top->protocol( 'WM_DELETE_WINDOW', \&my_clean_up_routine( $top, $another_parameter); #### $window->protocol('WM_DELETE_WINDOW',\&your_exit_handler); #### $window->protocol( 'WM_DELETE_WINDOW', \&Tk::NoOp);