Re: Deprecated "Graphics" dropped

Emile SCHWARZ <[email protected]> Wed, 26 Dec 2018 13:27:33 +0100 (CET)
Newsgroups gmane.comp.lang.realbasic.user
Message-ID <1352316382.1237197.1545827253204.JavaMail.open-xchange@opme11oxm21nd1.rouen.francetelecom.fr>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org=
/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns=3D"http://www.w3.org/1999/xhtml"><head>
    <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8=
"/>
 </head><body style=3D"font-family: arial,helvetica,sans-serif; font-size: =
13pt"><p>&#62;These types of errors happen on multiple other Modules. What =
should I do ?</p><p>Just before I closed the web tab, I noticed that.<br></=
p><p><br></p><p>I do not think you followed Xojo way of doing (the links I =
sent you).<br></p><p><br></p><p>In a simple sentence: you cannot anymore us=
e Graphics elsewhere of the Paint Event (so, not in a Module).<br></p><p>In=
 a Module case, create a new Picture (say Pict1), draw into it, then in the=
 place where you want to display the art, in the Paint Event use some code =
like:<br></p><p>If Pict1 &#60;&#62; Nil Then<br></p><p>g.DrawPicture Pict1,=
0,0</p><p>End If<br></p><p><br></p><p>I hope this helps.<br></p><p><br></p>=
<p>Have a happy new year.<br></p><p><br></p><blockquote type=3D"cite"><p>En=
voy&#233; : 26 d&#233;cembre 2018 &#224; 12:40de : Daniel Drijard &#60;Dani=
[email protected]&#62;<br>&#224; : Nug &#60;nug-Ktk10zIkF/Jvqtv/[email protected]&#62;<br>obj=
et : Re: Deprecated &#34;Graphics&#34; dropped<br><br><br>Jim, <br><br> I f=
ollowed your proposition and, indeed, some compilation errors disappeared. =
Some of them are, however, still present. In a Module ModWindow they protes=
t to my code<br> &#34;Me.Graphics.clearRect Me.Left,Me.Top,MeWidth,Me.Heigh=
t&#8221;<br> by<br> &#34;This method extends class Canvas, but the base exp=
ression is class ModWindow.ModWindow&#8221;<br> and to<br> &#34;Graphics.cl=
earRect(0,0,1000,1000)&#8221;<br> by<br> &#8220;Static reference to instanc=
e method: call this on an instance of class Graphics.&#8221;<br><br> There =
are as well errors on other codes such as<br> &#34;Me.Graphics.drawstring(s=
tr1,430,65,200)&#8221;<br><br> These types of errors happen on multiple oth=
er Modules. What should I do ?<br><br>Cordially, <br>Daniel<br><br></p><blo=
ckquote type=3D"cite"><p>On 23 12 2018, at 19:53, Jim McKay &#60;jim@pidog.=
com&#62; wrote:<br><br>My solution is very simple. You add a module to your=
 project (via the menu Insert-&#62;Module), call it &#8220;GraphicsBandaid&=
#8221; or whatever. Add a single method. Now your old code works, unmodifie=
d. I&#39;m not understanding how that is complex.<br><br>After you&#39;ve a=
dded the new method, calls to canvas1.graphics will simply be forwarded to =
canvas1.backdrop.graphics<br><br>The only real solution is to rewrite your =
code to only access the graphics from inside the paint event.<br><br>On Dec=
 23, 2018, at 6:34 AM, Daniel Drijard &#60;[email protected]&#62; wrot=
e:<br><br>I got later a new answer from [email protected] who proposes somethin=
g more complex to escape the problem, without solving it.</p></blockquote><=
p>Daniel Drijard<br>Thoiry t&#233;l&#233;phone : <br> 04 50 41 22 75<br> in=
ternational<br> +33/4 50 41 22 75<br>Courriel :<br> [email protected]<=
br>Thoiry F-01710<br> 48, rue des Savoies</p></blockquote></body></html>