[Gambas-user] Why is this code running twice?

Fernando Cabral fernandojosecabral at ...626...
Wed Aug 2 13:20:42 CEST 2017


2017-08-02 6:40 GMT-03:00 Fabien Bodard <gambas.fr at ...626...>:

> Ok Fernando ... your code is no so bad :-)
>
>
> ==> the code revised
>
>
Still being executed twice. I have not been able to understand why.

Thanks.

- fernando


> ' Gambas class file
>
> Private Const W As Integer = 2048
> Private Const H As Integer = 2048
>
> Public Sub _new()
>
>     dwgArea.width = 800 ' does nothing
>   dwgArea.Height = 1000 ' does nothing  Print dwgArea.width; dwgArea.Height
>   dwgArea.Refresh
> End
>
>
>
> Public Sub DwgArea_Draw()
>
>   Dim angle As Float
>   Dim eScale As Float
>   Dim i As Integer
>
>   Print "Executing" & Now
>
>   Paint.Translate(dwgArea.W / 2, dwgArea.H / 2)
>   Paint.Brush = Paint.Color(Color.SetAlpha(Color.Red, 128))
>   Paint.LineWidth = 1
>
>   For i = -15 To 195 Step 15
>
>     angle = Rad(CFloat(i))
>     Paint.MoveTo(0, 0)
>     Paint.LineTo(Cos(angle) * W / 2, Sin(angle) * H / 2)
>     Print Cos(angle) * w / 2
>     Paint.Stroke
>     'Paint.Fill
>   Next
>
> End
>
>
> Best Regards,
>
> Fabien Bodard
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
Fernando Cabral
Blogue: http://fernandocabral.org
Twitter: http://twitter.com/fjcabral
e-mail: fernandojosecabral at ...626...
Facebook: f at ...3654...
Telegram: +55 (37) 99988-8868
Wickr ID: fernandocabral
WhatsApp: +55 (37) 99988-8868
Skype:  fernandojosecabral
Telefone fixo: +55 (37) 3521-2183
Telefone celular: +55 (37) 99988-8868

Enquanto houver no mundo uma só pessoa sem casa ou sem alimentos,
nenhum político ou cientista poderá se gabar de nada.



More information about the User mailing list