Thanks, your code works fine.
A paintbox does not "remember" what you painted in an OnClick event. How could it? It has nothing to store that information.
I find this confusing... why should 'remembering' anything even be relevant if the paintbox is cleared prior to drawing on it? The problem appeared to be that the paintbox
was remembering which is why the previous list remained and didn't seem to be cleared even though I had used 'marquee.canvas.Clear'.
But anyway your comment tells me that I don't really understand how objects and the GUI model works at all. Up until now I've only written procedural programs and have been avoiding OOP. It seems I can't avoid it any longer (sigh). Quite frankly, it does my head in. There are lots of tutorials around but they are either very terse and assume too much or else they are too simple. Would it help to read some old Delphi books? Lazarus is based on Delphi 7 right?
I'm finding it all a bit overwhelming.