Skip to content

Commit

Permalink
[feenkcom/gtoolkit#4149] Converting element snippets to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar Nierstrasz committed Nov 5, 2024
1 parent 05dce62 commit 54ddeed
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,48 @@ Class {
#category : #'GToolkit-Demo-MoldableDevelopment-Examples'
}

{ #category : #example }
GtInspectorScripterExamples >> emptyStackMachine [
<gtExample>
^ StackMachineV0 new
]

{ #category : #example }
GtInspectorScripterExamples >> emptyStackMachineV1 [
<gtExample>
^ StackMachineV1 new
]

{ #category : #example }
GtInspectorScripterExamples >> emptyStackMachineV1WithPlaygroundCode [
<gtExample>
| scripter |
scripter := GtInspectorScripterExamples new
scriptedInspectorOn: self emptyStackMachineV1
WithPlaygroundText: 'self ! 3. self ! 4.'.
^ scripter elementWithoutParent
]

{ #category : #example }
GtInspectorScripterExamples >> emptyStackMachineWithGeneralizedPlaygroundCode [
<gtExample>
| scripter |
scripter := GtInspectorScripterExamples new
scriptedInspectorOn: self emptyStackMachine
WithPlaygroundText: 'stack addLast: aValue'.
^ scripter elementWithoutParent
]

{ #category : #example }
GtInspectorScripterExamples >> emptyStackMachineWithPlaygroundCode [
<gtExample>
| scripter |
scripter := GtInspectorScripterExamples new
scriptedInspectorOn: self emptyStackMachine
WithPlaygroundText: 'stack addLast: 3'.
^ scripter elementWithoutParent
]

{ #category : #accessing }
GtInspectorScripterExamples >> pixelsToMove [
"Number of pixels to raise the playground handle."
Expand Down Expand Up @@ -53,7 +95,7 @@ GtInspectorScripterExamples >> scriptedInspectorInPagerOn: anObject withPlaygrou
^ scripter
]

{ #category : #accessing }
{ #category : #example }
GtInspectorScripterExamples >> scriptedInspectorOn3plus4WithPlayground [
"Illustrates how to script an Inspector with an open playground."

Expand All @@ -66,7 +108,7 @@ GtInspectorScripterExamples >> scriptedInspectorOn3plus4WithPlayground [
^ scripter elementWithoutParent
]

{ #category : #accessing }
{ #category : #example }
GtInspectorScripterExamples >> scriptedInspectorOn3plus4WithPlaygroundSmalltalkEvaluate [
"Illustrates how to script an Inspector with an open playground."

Expand Down Expand Up @@ -104,3 +146,16 @@ GtInspectorScripterExamples >> scriptedInspectorOn: anObject WithPlaygroundText:

^ scripter
]

{ #category : #example }
GtInspectorScripterExamples >> stackMachineV1WithCodeEvaluated [
<gtExample>
| scripter |
scripter := GtInspectorScripterExamples new
scriptedInspectorInPagerOn: (StackMachineV1 new
! 3;
! 4;
yourself)
withPlaygroundTextAndDoit: 'self top'.
^ scripter elementWithoutParent
]
8 changes: 4 additions & 4 deletions src/GToolkit-Demo-Scripter/PatternScripterExamples.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ PatternScripterExamples >> cartoonAddressBookSearchScript [
text: 'u';
play.

^ scripter "elementWithoutParent"
^ scripter elementWithoutParent
]

{ #category : #example }
Expand Down Expand Up @@ -124,7 +124,7 @@ PatternScripterExamples >> customViewCustomMovesViewScript [
scripter doubleClick
label: 'Double-click on the row';
play.
^ scripter "elementWithoutParent"
^ scripter elementWithoutParent
]

{ #category : #example }
Expand All @@ -150,7 +150,7 @@ PatternScripterExamples >> customViewRawViewScript [
label: 'Open the 6th move';
id: #triangle index: 15;
play.
^ scripter "elementWithoutParent"
^ scripter elementWithoutParent
]

{ #category : #example }
Expand Down Expand Up @@ -230,7 +230,7 @@ PatternScripterExamples >> moldableToolViewCodeScript [
id: #bar index: 2;
modifiers: BlKeyModifiers alt;
play.
^ scripter "elementWithoutParent"
^ scripter elementWithoutParent
]

{ #category : #example }
Expand Down

0 comments on commit 54ddeed

Please sign in to comment.