sub Wait { my $cw = shift; $cw->Callback(-showcommand => $cw); $cw->waitVariable(\$cw->{'selected_button'}); $cw->grabRelease if Tk::Exists($cw); $cw->withdraw if Tk::Exists($cw); $cw->Callback(-command => $cw->{'selected_button'}); }