aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGene Pasquet <dev@etenil.net>2026-07-26 10:52:43 +0100
committerGene Pasquet <dev@etenil.net>2026-07-26 10:52:43 +0100
commitc9c3db4c0b6656203516c15f2881fae08731c327 (patch)
tree47df3d141321bb513d7f2a2a066027cd509672e6
parent198fcf265413929632580504ab91abc7460e6f31 (diff)
Fixes
-rw-r--r--class.lisp20
-rw-r--r--frame.lisp2
2 files changed, 9 insertions, 13 deletions
diff --git a/class.lisp b/class.lisp
index 93fc4d9..526418c 100644
--- a/class.lisp
+++ b/class.lisp
@@ -7,22 +7,18 @@
(defclass book ()
((haikus
- :initform (list "haiku 1"
- "haiku 2"
- "haiku 3"))
+ :initform (list "Old brackets~%laying forgotten~%spring anew."
+ "The water drop~%falling on the cracked ground~%bounces away."
+ "Striving for more~%time for contentment~%is gone."))
(current :initform 0)))
(defmethod display-haiku ((obj book) stream)
(with-slots (haikus current) obj
- (format *standard-output* "haiku num: ~a" current)
- (princ (nth current haikus) stream)))
+ (format *error-output* "Refreshing display, current is ~a" current)
+ (format stream (nth current haikus))))
(defmethod next-haiku ((obj book))
(with-slots (haikus current) obj
- (format *standard-output* "increasing current")
- (let ((factor (if (= current (length haikus)) 0 1)))
- (format *standard-output* "increment factor: ~a" factor)
- (finish-output *standard-output*)
- (setf current
- (+ factor
- current)))))
+ (if (= current (- (length haikus) 1))
+ (setf current 0)
+ (incf current))))
diff --git a/frame.lisp b/frame.lisp
index 2f3cc91..a4313c9 100644
--- a/frame.lisp
+++ b/frame.lisp
@@ -23,4 +23,4 @@
()
(with-application-frame (frame)
(next-haiku frame)
- (redisplay-frame frame)))
+ (redisplay-frame-pane frame 'app)))