a proper way to draw, while reacting on mouse-events

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Black Monkey

I want to use the drawing-methods, (draw_line(), draw_circle(), etc) , while I’m responding to mouse-events (hover, pressed, released, etc.)
a.t.m. I put all the drawing commands and parameters in 2 on-frame-alternating arrays, and let _draw() read these arrays and execute the functions.
It works, but I’m not sure if it works under all circumstances.
What would be a proper way to do this?
Thanks ahead!

:bust_in_silhouette: Reply From: Black Monkey

yeah, after rigoureos testing; errors creeped in.
Since draw() and onmousevent are asychronous, I’ll revert to a single queue, and push on the mouse side and pop on the draw side.
k.i.s.s.
Still seems a bit surplus though