point is shown where user clicks(left/right click) ->stored in array, point displayed via the same array

Created a pop up menu on right click
which includes a Cancel option
which needs to clear the last action the painter function done
(for instance the last action was drawing a point at x,y -> that point needs to be cleared, but only that point)

How do I go about doing that