$dialog->protocol('WM_DELETE_WINDOW' => sub { print "nope\n"; });