Hi all,
I know that the update of the graphics object of a canvas should take place only from the Paint event. I have two issues here:
I am on Windows
A.
- Create a subclass of the Canvas
- Add a method, eg. myRefresh
- in myRefresh write:
dim p as new picture(me.width, me.height)
self.graphics.drawpicture p,0,0
- Analyse the project (Ctrl-K)
The first time you get a warning about the deprecated item. If you analyse the project again, the compiler doesn’t complain.
So, what does this mean? That it doesn’t show the message again or the second time it doesn’t find any issues?
B. I am aware of the structure: GUI element (eg. canvas) - Timer - Thread
Now, all the examples I have come across put the timer and the thread outside the canvas (in the window class).
What about if I subclass Canvas and add a thread and a timer that calls the refresh? Most likely the timer isn’t a problem but is the thread safe?
Thanks for your help
John