New minimalistic example

This commit is contained in:
Offray Vladimir Luna Cárdenas 2016-01-13 08:51:43 +00:00
parent 16aca70b31
commit 3664284fd0
2 changed files with 67 additions and 3 deletions

View 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'
]

View File

@ -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;