New minimalistic example
This commit is contained in:
parent
16aca70b31
commit
3664284fd0
64
repository/Grafoscopio/DynamicDict.class.st
Normal file
64
repository/Grafoscopio/DynamicDict.class.st
Normal file
@ -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 [
|
||||
<spec: #default>
|
||||
|
||||
^ 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'
|
||||
]
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user