Hi,
For my Grafoscopio notebooks, I have implemented a way to auto-updating
the content of a node, so it is automatically saved in the notebook when
a node content is changed. The problem is that a node contains an
embedded playground that produces text as output when executed (for
example the playground reads a file or scraps HTML or calculates a
hash), the text of the playground is replaced with the executed output.
If the playground produces a visualization or non-textual output, this
doesn't happen.
I imagine that the source of the problem is here:
=======
GrafoscopioNotebook >> autoSaveBodyOf: aNode
body body class = TextModel
ifTrue: [ body body whenTextChanged: [ :arg | aNode body: arg ] ].
body body class = GlamourPresentationModel
ifTrue: [ | playground |
playground := body body glmPres.
playground
when: GLMContextChanged
do: [ :ann |
ann property = #text
ifTrue: [ | playgroundText |
playgroundText := (playground pane ports
at: 2) value.
aNode body: playgroundText ]
]
]
=======
as you can see the "when: GLMContextChanged" updates a node body with
the playgroundText, as intended, so I can capture any change of the
playground code, but I would like to add some condition to **not**
update the body content if the text is the result of a playground
execution. There is any way to do this?
Thanks,
Offray