Is it possible to get a canvas for a main DrGeo window in a script?

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

Is it possible to get a canvas for a main DrGeo window in a script?

philippeback
I wanted to use "FSD" like scripting in scripts (not what I can write in a
worskpace, in scripts in the main DrGeo windows).

But there doesn't seem to be a way to get access to a canvas from there.

I inspected a self arg1 and drilled down but it seems that there are only
math items and I cannot add points, polygons etc.

This would be nice to have.

How can I do have access to such a canvas?

TIA
Phil



--
Sent from: http://forum.drgeo.eu/Dr-Geo-users-f4023913.html

Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to get a canvas for a main DrGeo window in a script?

Hliaire Fernandes
Administrator
If I understand correctly what you want to do, you can't.

With scripts from the Dr. Geo main window, you only manipulate
*existing* mathematic items (the model or its costume).

You can not instantiate new item from there, and the workspace canvas
features and its high level API are not accessible either from there.

Of course hacking is possible, but it will help if you describe what you
want to achieve.

Hilaire

Le 28/01/2018 à 12:04, philippeback a écrit :

> I wanted to use "FSD" like scripting in scripts (not what I can write in a
> worskpace, in scripts in the main DrGeo windows).
>
> But there doesn't seem to be a way to get access to a canvas from there.
>
> I inspected a self arg1 and drilled down but it seems that there are only
> math items and I cannot add points, polygons etc.
>
> This would be nice to have.
>
> How can I do have access to such a canvas?
>
> TIA
> Phil

--
GNU Dr. Geo
http://drgeo.eu

Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to get a canvas for a main DrGeo window in a script?

philippeback
On Jan 28, 2018 15:49, "Hilaire Fernandes" <[hidden email]> wrote:

If I understand correctly what you want to do, you can't.

With scripts from the Dr. Geo main window, you only manipulate *existing*
mathematic items (the model or its costume).

You can not instantiate new item from there, and the workspace canvas
features and its high level API are not accessible either from there.


Ok that is the conclusion I have reached as well by looking at the code.
Very interesting BTW.


Of course hacking is possible, but it will help if you describe what you
want to achieve.


For example I'd like to pick 3 points and make a von Koch put of them. Or a
square and do a pythagore tree.

Vs Geogebra, Dr Geo would be better if it could do that.

I understand what scripts do at this point. So it may be another type of
script or a cross with metaconstruction.

And I would love to be able to reuse turtle graphics from Pen in DrGeo.

Is DrGeo working with 6.1? I see on the repo that one can load it but that
there are canvas issues.

Phil



Hilaire


Le 28/01/2018 à 12:04, philippeback a écrit :

> I wanted to use "FSD" like scripting in scripts (not what I can write in a
> worskpace, in scripts in the main DrGeo windows).
>
> But there doesn't seem to be a way to get access to a canvas from there.
>
> I inspected a self arg1 and drilled down but it seems that there are only
> math items and I cannot add points, polygons etc.
>
> This would be nice to have.
>
> How can I do have access to such a canvas?
>
> TIA
> Phil
>

--
GNU Dr. Geo
http://drgeo.eu
Reply | Threaded
Open this post in threaded view
|

Re : Re: Is it possible to get a canvas for a main DrGeo window in a script?

Hliaire Fernandes
Administrator
Hi Phil,

For Koch sketch I suggest using the workspace and Dr. Geo API. There are related examples in the DrGeo.app/SmalltlakSketches.

IMHO, comparing Dr.Geo and Geobra does not make much sense.

Regarding Turtle under Dr. Geo. Do you want Turtle art as interactive construction? What will be the expected outcome? Otherwise producing static turtle art with Dr. Geo does not bring added value.


There is an added pedagogical value producing interactive model, as with the SmalltalkSketches/Newton example.

Dr. Geo on P6.x will not work because of the Athens canvas bugs, it works nicely with P7 (https://dev.drgeo.eu)


----- [hidden email] a écrit :

> For example I'd like to pick 3 points and make a von Koch put of them. Or a
> square and do a pythagore tree.
>
> Vs Geogebra, Dr Geo would be better if it could do that.
>
> I understand what scripts do at this point. So it may be another type of
> script or a cross with metaconstruction.
>
> And I would love to be able to reuse turtle graphics from Pen in DrGeo.
>
> Is DrGeo working with 6.1? I see on the repo that one can load it but that
> there are canvas issues.
>
> Phil
>
>
>
> Hilaire
>
>
> Le 28/01/2018 à 12:04, philippeback a écrit :
>
> > I wanted to use "FSD" like scripting in scripts (not what I can write in a
> > worskpace, in scripts in the main DrGeo windows).
> >
> > But there doesn't seem to be a way to get access to a canvas from there.
> >
> > I inspected a self arg1 and drilled down but it seems that there are only
> > math items and I cannot add points, polygons etc.
> >
> > This would be nice to have.
> >
> > How can I do have access to such a canvas?
> >
> > TIA
> > Phil
> >
>
> --
> GNU Dr. Geo
> http://drgeo.eu