$open->withdraw(); #### if (defined $open) { $open->deiconify(); } else { # create the dialog window here }