my ($w) = @_; my $delay = delete $w->{'delay'}; $delay->cancel if defined $delay; if ($w->{'popped'}) { my $client = $w->{'client'}; my $command = $w->GetOption(-cancelcommand => $client); if (defined $command) { # Execute the user's command and return if it returns false: return if not $command->Call($client); } $w->withdraw; $w-> {'shadow'}-> withdraw; $w->ClearStatus; $w->{'popped'} = 0; $w->{'menu_index'} = 'none'; $w->{'canvas_tag'} = ''; } $w->{'client'} = undef; $w->{'subclient'} = undef; $w->{'location'} = undef;