Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar Nierstrasz committed Nov 6, 2024
1 parent c3ae305 commit 55bd888
Showing 1 changed file with 46 additions and 5 deletions.
51 changes: 46 additions & 5 deletions src/GToolkit-Demo-Scripter/PatternScripterExamples.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ PatternScripterExamples >> explicitMoveViewScript [
id: #bar index: 1;
modifiers: BlKeyModifiers alt;
play.
^ scripter "elementWithoutParent"
^ scripter elementWithoutParent
]

{ #category : #example }
Expand All @@ -176,6 +176,47 @@ PatternScripterExamples >> feenkGitHubOrgData [
^ self class urlData
]

{ #category : #'as yet unclassified' }
PatternScripterExamples >> gtBookLinksMondrian [
<gtExample>
<noTest>
| pages getStartedPage allReachedPages m |
pages := LeDatabase gtBook pages
reject: [ :each | each title = 'Glamorous Toolkit Book' ].
getStartedPage := pages detect: [ :each | each title = 'Glamorous Toolkit' ].
allReachedPages := getStartedPage
deepCollect: [ :each |
each allChildOutgoingTextualLinks
collectAsSet: [ :x | x target ifNotNil: #page ] ].
m := GtMondrian new.
m nodes
stencil: [ :each |
| color size |
color := (allReachedPages includes: each)
ifTrue: [ Color red ]
ifFalse: [ Color black ].
size := 5 @ 5.
each = getStartedPage
ifTrue: [ color := Color blue.
size := 10 @ 10 ].
BlElement new
background: color;
size: size;
when: BlClickEvent
do: [ :e | e currentTarget phlow spawnTool: each asPhlowTool ] ];
with: pages.
m edges
stencil: [ BlLineElement new
border: Color veryLightGray;
toHead: (BlArrowheadSimpleArrow new border: Color veryLightGray);
zIndex: -1 ];
connectToAll: [ :page | page allOutgoingTextualLinks collectAsSet: #target ].
m layout force
nbIterations: 30;
charge: -50.
^ m
]

{ #category : #example }
PatternScripterExamples >> moldableLudoGamePlaygroundScript [
"NB: Note the use of `do` to replace the playground snippet code."
Expand Down Expand Up @@ -275,7 +316,7 @@ PatternScripterExamples >> simpleForwardViewScript [
id: #bar index: 2;
modifiers: BlKeyModifiers alt;
play.
^ scripter "elementWithoutParent"
^ scripter elementWithoutParent
]

{ #category : #example }
Expand All @@ -294,7 +335,7 @@ PatternScripterExamples >> simpleListViewScript [
id: #bar index: 2;
modifiers: BlKeyModifiers alt;
play.
^ scripter "elementWithoutParent"
^ scripter elementWithoutParent
]

{ #category : #example }
Expand Down Expand Up @@ -386,7 +427,7 @@ PatternScripterExamples >> throwawayQueryToolScript [
label: 'Perform the snippet and go.';
id: GtSourceCoderDoItAndGoActionId;
play.
^ scripter "elementWithoutParent"
^ scripter elementWithoutParent
]

{ #category : #example }
Expand All @@ -413,7 +454,7 @@ PatternScripterExamples >> wrappedEsugWebsitePageCollectionScript [
id: GtPagerPageElementId index: 2;
id: #bar index: 2;
play.
^ scripter "elementWithoutParent"
^ scripter elementWithoutParent
]

{ #category : #example }
Expand Down

0 comments on commit 55bd888

Please sign in to comment.