Construct a Workspace window
Last updated at 6:48 am UTC on 14 April 2018
ToolBuilder open: Workspace
Sequence of message sends to construct a Workspace windows with the ToolBuilder.
ToolBuilder class>>open:
open: aClass
^self default open: aClass
MorphicToolBuilder>>open:
open: anObject
"Build and open the object. Answer the widget opened."
^ (self build: anObject) openAsTool
MorphicToolBuilder(ToolBuilder)>>build:
build: anObject
"Build the given object using this tool builder"
^anObject buildWith: self
Workspace class(Model class)>>buildWith:
buildWith: toolBuilder
^self new buildWith: toolBuilder
Workspace(StringHolder)>>buildWith:
buildWith: builder
| windowSpec |
windowSpec := self buildWindowWith: builder specs: {
(0@0corner: 1@1) -> [self buildCodePaneWith: builder].
}.
^builder build: windowSpec
Workspace>>buildCodePaneWith:
buildCodePaneWith: builder
| textSpec |
textSpec := builder pluggableCodePaneSpec new.
textSpec
model: self;
getText: #contents;
setText: #contents:notifying:;
selection: #contentsSelection;
menu: #codePaneMenu:shifted:.
^textSpec