The Trunk: Tools-mt.1054.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Tools-mt.1054.mcz

commits-2
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1054.mcz

==================== 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!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-mt.1054.mcz

Christoph Thiede

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? :-)


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Samstag, 1. Mai 2021 12:06:10
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: Tools-mt.1054.mcz
 
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1054.mcz

==================== 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!




Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-mt.1054.mcz

Jaromir Matas
Hi Marcel,
thanks, I love it! It saves me a lot of clicking when bringing the Workspace
and Transcript to the front or rearranging them :)


Christoph Thiede wrote
> Nice idea! :-)
>
> And should we maybe make this preference available for individual
> workspaces through the window menu, analogously to the shout setting?

I'd like that too - that's where I looked for the new preference first :)

Thanks again,
best,



-----
^[^ Jaromir
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

^[^ Jaromir