Hello Hilaire Your question is
In Pharo, do we have a text editor where it is possible to embed arbitrary Morph object?
I would put it differently: Use an object and embed Text editors and DrGeo canvas objects. This idea is taken out of a paper about literate programming by Trygver Reenskaug I cc him, maybe he is interested in answering. http://folk.uio.no/trygver/1989/1989.10.1-LiterateProgrammingOOPSLA.pdf An environment for literate Smalltalk programming He implemented a 'Galley editor'. The following is a simplified version of the idea. A TextMorph actually can work as a text editor as the following example will show. It uses a AlignmentMorph (called 'column') which has three submorphs, two of them being TextMorph objects: 1. aTextMorph 2. aDrGeoCanvas This is the result of DrGeoCanvas minimal which you implemented last week. 3. aTextMorph The text morphs are editable. Some fine tuning of TextMorph editing will be needed (pop-up menu, maybe keyboard shortcuts, alignment. But as a whole following a Squeak implementation should do the job ( http://wiki.squeak.org/squeak/837 ) The code | column box1 headingText box2 box3 ptA ptB ptC angle segA segB segC | column := AlignmentMorph newColumn cellPositioning: #topLeft. column hResizing: #shrinkWrap. column vResizing: #shrinkWrap. headingText := 'Right triangle (AE) / right-angled triangle (BE)' asText allBold. box1 := TextMorph new leftFlush. box1 contents: headingText. box1 backgroundColor: Color white. column addMorphBack: box1. c := DrGeoCanvas minimal. ptA := c point: 0@0. ptA name: 'A'. ptB := c point: 4@3. ptB name: 'B'. ptC := c point: 4@0. ptC name: 'C'. angle := c angle: ptB to: ptC to: ptA. angle show. c segment: ptC to: ptA. segA :=c segment: ptC to: ptB. segA name: 'a'. segB := c segment: ptC to: ptA. segB name: 'b'. segC := c segment: ptA to: ptB. segC name: 'c'. box2 := c. column addMorphBack: box2 view. box3 := TextMorph new leftFlush. box3 contents: 'a triangle in which one angle is a right angle'. box3 backgroundColor: Color lightGray. column addMorphBack: box3. column openInWorld. I think this road can be extended for a nice extended Dynabook implementation A stack of boxes or cells following the Jupyter notebook idea. Later on put it into a window or re-implementation of a BookMorph (a 'light version'). Maybe in Pharo there are also other TextEditors which are fine. But a TextMorph seems to do the job. Regards Hannes On 10/6/18, Hilaire <hilaire@drgeo.eu> wrote:
If there are no such text editor, is there a best candidate to inherit from and extend?
I have about no knowledge regarding the text editor implementations in Pharo.
Hilaire
Le 03/10/2018 à 18:31, Hilaire a écrit :
In Pharo, do we have a text editor where it is possible to embed arbitrary Morph object?
-- Dr. Geo http://drgeo.eu