Re: Deprecated "Graphics" dropped

Jim McKay <[email protected]> Wed, 26 Dec 2018 16:44:11 +0000 (UTC)
Newsgroups gmane.comp.lang.realbasic.user
Message-ID <[email protected]>
------------=_1545842650-4745-1191
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable

It looks like you're also drawing into window.graphics. If you want to use =
my bandaid solution, just add another global method.


Public Function graphics(extends w as window) as Graphics
If w.Backdrop=3DNil Then w.Backdrop=3DNew Picture(w.Width,w.Height)
w.Invalidate
Return w.Backdrop.Graphics
End Function

Where you see the static reference error, you'll need to add the reference =
to the window or canvas, ie self.graphics.clearRect

Just understand that this is not the "right" or efficient way to do things =
and you may end up with a less that satisfying result until you are able to=
 rewrite your code as stated by the other replies.



> On Dec 26, 2018, at 4:40 AM, Daniel Drijard <[email protected]> wrot=
e:
>=20
> Jim,=20
>=20
>   I followed your proposition and, indeed, some compilation errors disapp=
eared. Some of them are, however, still present. In a Module ModWindow they=
 protest to my code
>   "Me.Graphics.clearRect Me.Left,Me.Top,MeWidth,Me.Height=E2=80=9D
>         by
>   "This method extends class Canvas, but the base expression is class Mod=
Window.ModWindow=E2=80=9D
>         and to
>   "Graphics.clearRect(0,0,1000,1000)=E2=80=9D
>         by
>   =E2=80=9CStatic reference to instance method: call this on an instance =
of class Graphics.=E2=80=9D
>=20
>   There are as well errors on other codes such as
>   "Me.Graphics.drawstring(str1,430,65,200)=E2=80=9D
>=20
>   These types of errors happen on multiple other Modules. What should I d=
o ?
>=20
> Cordially,=20
> Daniel
>=20


------------=_1545842650-4745-1191
Content-Type: text/html; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

<html><body>
<p>It looks like you're also drawing into window.graphics. If you want to u=
se my bandaid solution, just add another global method.</p>
<p>Public Function graphics(extends w as window) as Graphics If w.Backdrop=
=3DNil Then w.Backdrop=3DNew Picture(w.Width,w.Height) w.Invalidate Return =
w.Backdrop.Graphics End Function</p>
<p>Where you see the static reference error, you'll need to add the referen=
ce to the window or canvas, ie self.graphics.clearRect</p>
<p>Just understand that this is not the &ldquo;right&rdquo; or efficient wa=
y to do things and you may end up with a less that satisfying result until =
you are able to rewrite your code as stated by the other replies.</p>
<blockquote><p>On Dec 26, 2018, at 4:40 AM, Daniel Drijard &lt;daniel.drija=
[email protected]&gt; wrote:</p>
<p>Jim,</p>
<pre>I followed your proposition and, indeed, some compilation errors disap=
peared. Some of them are, however, still present. In a Module ModWindow the=
y protest to my code
"Me.Graphics.clearRect Me.Left,Me.Top,MeWidth,Me.Height=E2=80=9D
      by
"This method extends class Canvas, but the base expression is class ModWind=
ow.ModWindow=E2=80=9D
      and to
"Graphics.clearRect(0,0,1000,1000)=E2=80=9D
      by
=E2=80=9CStatic reference to instance method: call this on an instance of c=
lass Graphics.=E2=80=9D</pre>
<pre>There are as well errors on other codes such as
"Me.Graphics.drawstring(str1,430,65,200)=E2=80=9D</pre>
<pre>These types of errors happen on multiple other Modules. What should I =
do ?</pre>
<p>Cordially, Daniel</p></blockquote>

<img src=3D"https://u9098352.ct.sendgrid.net/wf/open?upn=3DW5IIOHYh8Ix-2Flm=
NrgtTomW8ATk7pXvOSwl3ev5ZofJdLJxnt7Er0dcqUD7KGeTKmH-2Fk1WhBPUc2byZ2BTGtQHJD=
9C2wXYQoP4MxChTq79p7yAntt8BCLmAkP56LWtMQlHQIGC-2FYAhcHQl1jS3lPIzziL7e-2FcL9=
3EbFyFVe-2B5zuiAKSXwsGRDTdkJGO7nFLVQ-2Fb5MfNHQijVXyuv9-2F5kvowKpHPhfw6VJba3=
7c106x54-3D" alt=3D"" width=3D"1" height=3D"1" border=3D"0" style=3D"height=
:1px !important;width:1px !important;border-width:0 !important;margin-top:0=
 !important;margin-bottom:0 !important;margin-right:0 !important;margin-lef=
t:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding=
-right:0 !important;padding-left:0 !important;"/>
</body></html>

------------=_1545842650-4745-1191--