diff --git a/source/clog-gui.lisp b/source/clog-gui.lisp index a8126f0..21e0e86 100644 --- a/source/clog-gui.lisp +++ b/source/clog-gui.lisp @@ -1419,6 +1419,21 @@ with a-list of field name to value if confirmed or nil if canceled." (format nil "" (second s) (first s))) (fourth l))))) + ((eq (third l) :radio) + (format nil + "
~A" + (first l) + (format nil "~{~A~}" + (mapcar (lambda (s) + (format nil + "
~ +
" + html-id (second l) + html-id (second l) (second s) + (second s) + html-id (second l) (second s) + (first s))) + (fourth l))))) (t (format nil "
~ @@ -1485,19 +1500,19 @@ with a-list of field name to value if confirmed or nil if canceled." (set-on-window-close win nil) (when modal (window-end-modal win)) - (let ((result (mapcar (lambda (l) - `(,(second l) - ,(if (eq (third l) :select) - (select-value win (format nil "~A-~A" - html-id - (second l))) - (name-value win (format nil "~A-~A" - html-id - (second l)))))) - fields))) + (let ((result (mapcar + (lambda (l) + `(,(second l) + ,(let ((name (format nil "~A-~A" html-id (second l)))) + (cond ((eq (third l) :select) + (select-value win name)) + ((eq (third l) :radio) + (radio-value win name)) + (t + (name-value win name)))))) + fields))) (window-close win) (funcall on-input result))) - :one-time t) (set-on-window-close win (lambda (obj) (declare (ignore obj)) diff --git a/tutorial/22-tutorial.lisp b/tutorial/22-tutorial.lisp index e2c4e95..77df9fe 100644 --- a/tutorial/22-tutorial.lisp +++ b/tutorial/22-tutorial.lisp @@ -78,6 +78,10 @@ ("Mrs." "mrs") ("Ms." "ms") ("Other" "other"))) + ("Eye Color" "color" :radio (("Blue" "blue") + ("Brown" "brown") + ("Green" "green") + ("Other" "other"))) ("Name" "name") ("Address" "address") ("City" "city")