sub removeData { my ($client,$login,$mw) = @_; my @tapes = getTapes($client,$login); #Create a DialogBox my $dlg = $mw->DialogBox(-title =>"Delete tape for: ".$$client, -buttons =>['Delete','Cancel'], -borderwidth=>5); my $list = $dlg->Scrolled('Listbox', -scrollbars=>'oe os', -background=>'black', -foreground=>'white', -height =>12, -width =>12)->pack(); $list->insert('end',$_) for @tapes; my $choice= $dlg->Show(); my $num = $list->get($list->curselection()); #If the user chose Delete if(lc($choice) eq 'delete') { #Drop the listbox $list->packForget(); #Reconfigure the dialog title $dlg->configure(-title =>'Delete Confirmation!'); #Reconfigure the dialog button text $dlg->Subwidget('B_Delete')->configure(-text=>'Yes'); $dlg->Subwidget('B_Cancel')->configure(-text=>'No'); $dlg->Label(-text=>"Tape:".$num." will be deleted. Are you sure?")->pack(); if(lc($dlg->Show()) eq 'yes') { my $success = deleteTape($client,\$num,$login); } } return; }