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

Loading…
Cancel
Save