diff --git a/repository/Grafoscopio/DynamicDict.class.st b/repository/Grafoscopio/DynamicDict.class.st new file mode 100644 index 0000000..71d08de --- /dev/null +++ b/repository/Grafoscopio/DynamicDict.class.st @@ -0,0 +1,64 @@ +" +I'm just a way to explore Spec and its documentation for learning purposes. +" +Class { + #name : #DynamicDict, + #superclass : #ComposableModel, + #instVars : [ + 'list', + 'content' + ], + #category : #'Grafoscopio-UI' +} + +{ #category : #'as yet unclassified' } +DynamicDict class >> defaultSpec [ + + + ^ SpecLayout composed + add: #list; + yourself +] + +{ #category : #accessing } +DynamicDict >> content [ + ^ content +] + +{ #category : #accessing } +DynamicDict >> content: anObject [ + content := anObject +] + +{ #category : #'as yet unclassified' } +DynamicDict >> initializePresenter [ + list whenSelectedItemChanged: [:item | + self rebuildWithNewLayout. + + ] +] + +{ #category : #initialization } +DynamicDict >> initializeWidgets [ + + | data | + data := { 'first' -> 'I\"m just text' . 'second' -> 'ProfStef openPharoZenWorkspace'} asOrderedDictionary. + list := self newList. + list items: data keys. + self focusOrder add: list. +] + +{ #category : #accessing } +DynamicDict >> list [ + ^ list +] + +{ #category : #accessing } +DynamicDict >> list: anObject [ + list := anObject +] + +{ #category : #api } +DynamicDict >> title [ + ^'Dynamic UI | test' +] diff --git a/repository/Grafoscopio/GrafoscopioGUI.class.st b/repository/Grafoscopio/GrafoscopioGUI.class.st index c94465b..b8c8519 100644 --- a/repository/Grafoscopio/GrafoscopioGUI.class.st +++ b/repository/Grafoscopio/GrafoscopioGUI.class.st @@ -248,9 +248,9 @@ GrafoscopioGUI >> initializeWidgets [ tree := self tree. nodeHeader := self newTextInput. nodeBody := - tree selectedItem notNil - ifTrue: [ self updateBody ] - ifFalse: [nodeBody := self newText]. + tree selectedItem + ifNotNil: [ self updateBody ] + ifNil: [nodeBody := self newText]. windowMainMenu applyTo: self. self focusOrder add: windowMainMenu;