← Каталог
SmallDesktop на Morphic — практикум — 5.2. Действия с заметками
Фрагмент из «SmallDesktop на Morphic — практикум»: 5.2. Действия с заметками.
addNote
noteStore addNote: noteInputModel contents ifTrue: [
noteInputModel contents: ''.
self refreshNotes ]
clearNotes
noteStore clearAll.
self refreshNotes
deleteNoteAt: anIndex
noteStore removeAt: anIndex.
self refreshNotes
refreshNotes
| origin index |
noteListMorph removeAllMorphs.
origin := 0 @ 0.
index := 1.
noteStore allNotes do: [ :each |
| row |
row := DesktopNoteRowMorph new initializeApp: self at: index text: each.
row extent: 370 @ 28.
row position: origin.
noteListMorph addMorph: row.
origin := origin + (0 @ 32).
index := index + 1 ].
self refreshStatusBar addNote
noteStore addNote: noteInputModel contents ifTrue: [
noteInputModel contents: ''.
self refreshNotes ]
clearNotes
noteStore clearAll.
self refreshNotes
deleteNoteAt: anIndex
noteStore removeAt: anIndex.
self refreshNotes
refreshNotes
| origin index |
noteListMorph removeAllMorphs.
origin := 0 @ 0.
index := 1.
noteStore allNotes do: [ :each |
| row |
row := DesktopNoteRowMorph new initializeApp: self at: index text: each.
row extent: 370 @ 28.
row position: origin.
noteListMorph addMorph: row.
origin := origin + (0 @ 32).
index := index + 1 ].
self refreshStatusBar