sub del { my( $self, @num ) = @_; # pick parameters $self->close if $self->{container}->ismapped; # close the menu if it is being displayed # delete menu entries for my $i ( sort { $b <=> $a } @num # sort this to delete the right entries ) { $self->{menu}->[$i] -> destroy(); # destroy the menu entry splice( @{ $self->{menu} }, $i, 1 ); # delete the array member } # for return $self; # return object } # del sub close { my( $self ) = @_; # pick parameters $self->{shadow} -> withdraw; # close shadow $self->{container} -> withdraw; # close menu return $self; # return object } # close sub show { my( $self, $x, $y ) = @_; # pick parameters $self->close if $self->{container}->ismapped; # close menu if it is being displayed # set shadow position $self->{shadow} -> geometry( '=' . $self->{container}->reqwidth . # menu width 'x' . $self->{container}->reqheight . # menu height '+' . ( $x + 3 ) . # menu x position + extra pixels for the shadow '+' . ( $y + 3 ) # menu y position + extra pixels for the shadow ); $self->{shadow} -> deiconify; # show shadow $self->{container} -> geometry("+$x+$y"); # set menu position $self->{container} -> deiconify; # show menu $self->{container} -> raise( $self->{shadow} ); # draw the menu over the shadow $self->{container} -> focus(); # give focus() to the menu return $self; # return object } # show 1;