Skip to content

ToDo list application

Hannes Hirzel edited this page Jan 7, 2015 · 3 revisions

Stub of a tutorial

There is a ToDo list application done for Amber version 0.12

https://github.com/hhzl/Amber-ToDo-List

This is not a tutorail yet but a page which will contain some notes about the ToDo list application.

Watch out for more details to be added in the upcoming days, hhzl, 7th Jan 2015

Rendering of the GUI

From: https://github.com/hhzl/Amber-ToDo-List/edit/master/src/Examples-ToDo.st

!Todo methodsFor: 'rendering'!

renderOn: html
   | input delete |
   html li
     id: self id;
          with: [
               input := html input
               type: 'checkbox';
                   onClick: [
                   self toggleIsDone.
                      onTodoChanged value: self. 
                      (input asJQuery next) toggleClass: 'done' ].
                      html span with: text .
                      delete := html span
                      with: '  [x]';
                   onClick: [ onDeleteClicked value: self ]].
          isDone ifTrue: [ 
                 input at: 'checked' put: 'checked'.
          (input asJQuery next) addClass: 'done'].

! !

Clone this wiki locally