[Gambas-user] Correct way to .Refresh a DrawingArea with Paint?
Jussi Lahtinen
jussi.lahtinen at gmail.com
Sun Apr 26 23:44:02 CEST 2020
> It is with a timer? like:
>
> Public Sub tmrTick_Timer()'at 33Hz
>
> daPlanta1.Refresh ' here?
>
> End
>
> or
>
> Public Sub daPlanta1_MouseMove()
>
> NewX = Mouse.X' used to change things
> NewY = Mouse.Y
> daPlanta1.Refresh ' or here?
>
> End
>
Either one should work, but the latter can cause a lot of extra calls.
Maybe enable the timer on mouse move event for optimal CPU usage.
> Also, what happens when I draw a lot of things and .Refresh is called
> BEFORE the _Draw event finished?
>
I don't think that can happen. Unless you do something wrong like put wait
command in the event.
Jussi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200427/08217ba5/attachment.html>
More information about the User
mailing list