[squeak-dev] The Trunk: Tools-mt.1054.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Sat May 1 16:23:20 UTC 2021

Nice idea! :-)

Hmm ... in my Trunk image, the text is not added to the embedded transcript, but it gets an orange triangle. When I debug the test, it works again. Any ideas why?

And should we maybe make this preference available for individual workspaces through the window menu, analogously to the shout setting?

And one more thought: Do we still want the Transcript to be global? If Transcript was properly scoped, e.g. using an exception or a dynamic variable, we could also make transcript messages triggered from a workspace exclusive for the embedded transcript. What do you think? :-)



Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Samstag, 1. Mai 2021 12:06:10
An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org
Betreff: [squeak-dev] The Trunk: Tools-mt.1054.mcz

Marcel Taeumel uploaded a new version of Tools to project The Trunk:

==================== Summary ====================

Name: Tools-mt.1054
Author: mt
Time: 1 May 2021, 12:06:08.609299 pm
UUID: 9da21c77-f717-ab4c-b024-42dfbe629f2e
Ancestors: Tools-mt.1053

Adds preference and means to embed a transcript in workspaces. Thanks to Jaromir (jar) for the idea!

The preference is disabled by default.

=============== Diff against Tools-mt.1053 ===============

Item was changed:
  StringHolder subclass: #Workspace
         instanceVariableNames: 'bindings acceptDroppedMorphs acceptAction mustDeclareVariables shouldStyle environment'
+        classVariableNames: 'DeclareVariablesAutomatically EmbedTranscript LookupPools ShouldStyle'
-        classVariableNames: 'DeclareVariablesAutomatically LookupPools ShouldStyle'
         poolDictionaries: ''
         category: 'Tools-Base'!

  !Workspace commentStamp: 'fbs 6/2/2012 20:46' prior: 0!
  A Workspace is a text area plus a lot of support for executable code.  It is a great place to execute top-level commands to compute something useful, and it is a great place to develop bits of a program before those bits get put into class methods.

  To open a new workspace, execute:

         Workspace open

  A workspace can have its own variables, called "workspace variables", to hold intermediate results.  For example, if you type into a workspace "x := 5" and do-it, then later you could type in "y := x * 2" and y would become 10.

  Additionally, in Morphic, a workspace can gain access to morphs that are on the screen.  If acceptDroppedMorphs is turned on, then whenever a morph is dropped on the workspace, a variable will be created which references that morph.  This functionality is toggled with the window-wide menu of a workspace.

  The instance variables of this class are:

         bindings  -  holds the workspace variables for this workspace

         acceptDroppedMorphs - whether dropped morphs should create new variables!

Item was added:
+ ----- Method: Workspace class>>embedTranscript (in category 'preferences') -----
+ embedTranscript
+        <preference: 'Embed a Transcript in Workspace'
+                category: 'browsing'
+                description: 'If true, new workspaces will open with an embedded Transcript.'
+                type: #Boolean>
+        ^ EmbedTranscript ifNil: [ false ]!

Item was added:
+ ----- Method: Workspace class>>embedTranscript: (in category 'preferences') -----
+ embedTranscript: aBoolean
+        EmbedTranscript := aBoolean.!

Item was added:
+ ----- Method: Workspace>>buildTranscriptWith: (in category 'toolbuilder') -----
+ buildTranscriptWith: builder
+        | textSpec |
+        textSpec := builder pluggableTextSpec new.
+        textSpec
+                model: Transcript;
+                menu: #codePaneMenu:shifted:.
+        ^ textSpec!

Item was added:
+ ----- Method: Workspace>>buildWith: (in category 'toolbuilder') -----
+ buildWith: builder
+        ^ self class embedTranscript
+                ifTrue: [self buildWorkspaceTranscriptWith: builder]
+                ifFalse: [super buildWith: builder]!

Item was added:
+ ----- Method: Workspace>>buildWorkspaceTranscriptWith: (in category 'toolbuilder') -----
+ buildWorkspaceTranscriptWith: builder
+        | windowSpec |
+        windowSpec := self buildWindowWith: builder specs: {
+                (0.0 @ 0.0 corner: 1.0 @ 0.6) -> [self buildCodePaneWith: builder].
+                (0.0 @ 0.6 corner: 1.0 @ 1.0) -> [self buildTranscriptWith: builder].
+        }.
+        ^builder build: windowSpec!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210501/2b96883b/attachment.html>

More information about the Squeak-dev mailing list