How do I dismiss a DrGeoCanvas object?

classic Classic list List threaded Threaded
4 messages Options
HJH
Reply | Threaded
Open this post in threaded view
|

How do I dismiss a DrGeoCanvas object?

HJH
Hello

I have the following simple script in a "Playground" (workspace). In the end I want to create a sequence of sketches and take screen shots of them.

    | c |
    c := DrGeoCanvas new.
    c view extent: 500@500.
    c point: 2 @ 2.
    c point: 2 @ 4.
    c point: 4 @ 4.
    c segment:  2@2 to: 4@4.

    c view area imageForm inspect.   "use later for PNG export"
    c view area presenter exportToBitmap.
    c inspect.

How do I dismiss the DrGeoCanvas object c?

--Hannes
Reply | Threaded
Open this post in threaded view
|

Re: How do I dismiss a DrGeoCanvas object?

Hilaire Fernandes
Administrator
Le 10/09/2018 à 17:17, HJH [via Dr. Geo Forum] a écrit :
Hello

I have the following simple script in a "Playground" (workspace). In the end I want to create a sequence of sketches and take screen shots of them.

    | c |
    c := DrGeoCanvas new.
    c view extent: 500@500.
    c point: 2 @ 2.
    c point: 2 @ 4.
    c point: 4 @ 4.
    c segment:  2@2 to: 4@4.

    c view area imageForm inspect.   "use later for PNG export"
    c view area presenter exportToBitmap.
    c inspect.

How do I dismiss the DrGeoCanvas object c?

What do you mean by dismiss? Garbage collected, remove from World?

For a complete remove and collection, try :

|c |
c := DrGeoCanvas new.
c point: 0@0.
c view app saved: true.
c view delete.
c := nil.

Was this message helpful?
Tell us!
HJH
Reply | Threaded
Open this post in threaded view
|

Re: How do I dismiss a DrGeoCanvas object?

HJH
Yes, with 'dismiss' I mean to remove the window from the world (desktop).

     c delete

did not work. Interesting that I need to delete the view only.

--Hannes
Reply | Threaded
Open this post in threaded view
|

Re: How do I dismiss a DrGeoCanvas object?

Hilaire Fernandes
Administrator
Le 10/09/2018 à 19:24, HJH [via Dr. Geo Forum] a écrit :
> Yes, with 'dismiss' I mean to remove the window from the world (desktop).
>
>      c delete

One can write this method with the code I wrote in my previous email.

>
> did not work. Interesting that I need to delete the view only.

Yes, because this is from where is activated in the UI.
Now you should look at what does delete, it does a lot, not only
removing the view from the World.

Hilaire

Was this message helpful?
Tell us!