[Pharo-dev] confused about printString and printIt
btc at openinworld.com
Sun Feb 19 10:33:20 EST 2017
On Sun, Feb 19, 2017 at 1:26 AM, stepharong <stepharong at free.fr> wrote:
> Hi guys
> I'm working on an introduction chapter for my future book and I do not like
> the behavior I see in latest pharo 60.
> And I do not understand the behavior of print-it
> (MFDirectory new name: 'comics')
> (MFDirectory new name: 'comics') printString
> Why print it does not produce ''?
> | printString |
> evaluateSelectionAndDo: [ :result |
> printString := [ result printString ]
> on: Error
> do: [ '<error in printString: try ''Inspect
> it'' to debug>' ].
> self afterSelectionInsertAndSelect: printString ]
btw, the code you reference there does not get executed from
Playground. This does...
title: 'Print it';
action: [ :aPresentation | aPresentation printSelection ];
keymap: PharoShortcuts current printItShortcut;
which announces GLMPrintSelection
leading to GLMMorphicPharoScriptRenderer>>evaluateAndPopPrintHighlight
"Evaluates selected code and prints it in a popper"
textMorph textArea editor highlightEvaluateAndDo: [ :result |
textMorph shoutStyler style: textMorph text.
openFromRubric: textMorph textArea withResult: result ]
More information about the Pharo-dev