On 18-09-15 22:52, Henrik Nergaard wrote:
It does not seem that RubScrolledTextMorph supports duplication/copy (tried to duplicate one from nautilus code area and the same clear all code happened. Trying to duplicate a Playground just freezes the image (might be some circular references that is not handled when copying )).
Anyway: this code works ish.. (does not add unaccepted edits)
CodeCard>>#duplicate | newCard |
newCard := self class new. newCard selector: self selector; "must be before selectedClass" selectedClass: self selectedClass; updateCodeWith: self textModel text. self activeHand attachMorph: newCard. "attachMorph: is nicer than grabMorph: :)"
selected := false. self changed.
Thanks Henrik. I'm slowly getting to the finer points of Morphic. Stephan