Skip to content

Commit

Permalink
Added GUI Integration idea
Browse files Browse the repository at this point in the history
  • Loading branch information
julia-tonne committed Jun 23, 2024
1 parent 6768d25 commit 6b97977
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
23 changes: 22 additions & 1 deletion src/SqueakKara-Core/SKEnvironment.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,37 @@ SKEnvironment >> initialize [

{
#category : #initialization,
#'squeak_changestamp' : 'JJG 6/18/2024 18:47'
#'squeak_changestamp' : 'jt 6/23/2024 19:47'
}
SKEnvironment >> initializeWithChallenge1 [

| gameWindow textMorph |

self grid: (SKGrid newWithExtent: 7 @ 7).
self kara: self grid challenge1.
self workspace: (SKWorkspace newWithKara: self kara).
self executer: (SKExecuter new).
(self executer kara) kara: self kara.
self executeControls: SKExecuteControls new.
executeControls environment: self.

gameWindow := SystemWindow new.
gameWindow setLabel: 'Kara'.

textMorph := PluggableTextMorph on: self workspace contents
text: #contents
accept: #contents:
readSelection: nil
menu: #codePaneMenu:shifted:.
textMorph borderWidth: 1.
textMorph extent: self grid width @ self grid height.

gameWindow addMorph: self executeControls frame: (0.0@0.0 corner: 1.0@0.1).
gameWindow addMorph: textMorph frame: (0.0@0.1 corner: 0.5@1.0).
gameWindow addMorph: self grid frame: (0.5@0.1 corner: 1.0@1.0).

gameWindow openInWorld.

]

{
Expand Down
4 changes: 2 additions & 2 deletions src/SqueakKara-Core/SKGrid.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ SKGrid >> gridWidth: aNumber [

{
#category : #initialization,
#'squeak_changestamp' : 'JJG 6/12/2024 16:47'
#'squeak_changestamp' : 'jt 6/23/2024 19:38'
}
SKGrid >> initialize [

super initialize.
self openInWorld;
self "openInWorld;"
color: self backgroundColor


Expand Down
4 changes: 2 additions & 2 deletions src/SqueakKara-Core/SKWorkspace.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ SKWorkspace >> getExampleCode [

{
#category : #initialization,
#'squeak_changestamp' : 'KD 6/12/2024 18:41'
#'squeak_changestamp' : 'jt 6/23/2024 19:38'
}
SKWorkspace >> initializeWithKara: aKara [

super initialize.
self buildAndOpen.
"self buildAndOpen."
self windowTitle: 'SKWorkspace'.

"replace, when kara turn method is updated"
Expand Down

0 comments on commit 6b97977

Please sign in to comment.