Browse Source

Bugfix

master
Silas Vedder 2 years ago
parent
commit
0dffd44f75
  1. 35
      chapter.lisp

35
chapter.lisp

@ -11,23 +11,22 @@
(values (create-div win) (values (create-div win)
drop-down))) drop-down)))
(defmacro translations-drop-down () (defun translations-drop-down (div display verses drop-down)
`(progn (mapcar
,@(mapcar (lambda (translation)
(lambda (translation) (labels ((verse-to-clog (verse)
`(labels ((verse-to-clog (verse) (v:verse-to-clog verse
(v:verse-to-clog verse div
div :translation (second translation)))
:translation ,(second translation))) (hide-verse (verse) (setf (hiddenp verse) t))
(hide-verse (verse) (setf (hiddenp verse) t)) (callback (obj)
(callback (obj) (declare (ignore obj))
(declare (ignore obj)) (mapc #'hide-verse display)
(mapc #'hide-verse display) (setf display (mapcar #'verse-to-clog verses))))
(setf display (mapcar #'verse-to-clog verses)))) (create-gui-menu-item drop-down
(create-gui-menu-item drop-down :content (first translation)
:content ,(first translation) :on-click #'callback)))
:on-click #'callback))) d:*translations*))
d:*translations*)))
(defun display-chapter-or-book (canvas title verses) (defun display-chapter-or-book (canvas title verses)
(multiple-value-bind (div drop-down) (multiple-value-bind (div drop-down)
@ -37,7 +36,7 @@
div div
:translation d:*translation*))) :translation d:*translation*)))
(let ((display (mapcar #'verse-to-clog verses))) (let ((display (mapcar #'verse-to-clog verses)))
(translations-drop-down))))) (translations-drop-down div display verses drop-down)))))
(defun load-chapter (canvas book chapter) (defun load-chapter (canvas book chapter)
(display-chapter-or-book canvas (display-chapter-or-book canvas

Loading…
Cancel
Save