Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsDraw with GC on Canvas and redraw the canvas
https://www.eclipse.org/forums/index.php/mv/msg/146378/460784/#msg_460784
Originally posted by: ssc.acentic.net
Hi
I have a little problem with GC. I like to draw something, in this case
on a canvas. Drawing is not the problem, but redraw the canvas and drawing
something in the same method seems to be.
With this code, I do not see the green rectangle. If I remove the redraw
command, it works, but it will paint over and over again.
Any idea how to avoid this ?
-Sebastian]]>2005-09-07T06:24:08-00:00Re: Draw with GC on Canvas and redraw the canvas
https://www.eclipse.org/forums/index.php/mv/msg/146378/460786/#msg_460786
Originally posted by: ssc.acentic.net
Nevermind, a simple canvas.update(); after the redraw, did the job.]]>2005-09-07T06:46:51-00:00Re: Draw with GC on Canvas and redraw the canvas
https://www.eclipse.org/forums/index.php/mv/msg/146378/460806/#msg_460806
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You really should not be doing drawing outside of a PaintListener
callback. That is because there are many reasons why your Canvas could
be redrawn. Such as someone covered it up and then reexposed it. In that
case your extra drawing will disappear. Instead you should add a
PaintListener and use the GC passed into the PaintListener to do your
extra painting. That way it will show up no matter why the Canvas was
redrawn.
Sebastian Scholz wrote:
> Nevermind, a simple canvas.update(); after the redraw, did the job.