Class Image


back
edit   | w p pp b s |
w <- Window new title: 'Image editor'. w width: 300 height: 300.
p <- Pane image: self. pp <- nil. s <- Semaphore new.
p onMouseDown: [:np | pp <- np].
p onMouseUp: [:np | pp <- nil ].
p onMouseMove: [:np | pp notNil ifTrue:
[ self at: pp drawLine: np. pp <- np. w repaint ] ].
b <- Array new: 2.
b at: 1 put: (Pane title: 'color' action: [ self setColor: Color select ]).
b at: 2 put: (Pane title: 'close' action: [ s set: self. w close ]).
w setPane: (Pane north: nil south: nil east: nil west:
(Pane rows: 2 columns: 1 data: b) center: p).
w show. ^ s wait