Skip to content

Commit

Permalink
conscript,survey-tools: add optional make-widget-proc-expr to make-sl…
Browse files Browse the repository at this point in the history
…iders
  • Loading branch information
Bogdanp committed Mar 15, 2024
1 parent ac63544 commit 5db9282
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions conscript/survey-tools.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,24 @@

(define-syntax (make-sliders stx)
(syntax-parse stx
[(_ n:nat)
(with-syntax ([(kwd ...)
(map
string->keyword
(build-list
(syntax-e #'n)
(lambda (i) (format "slider-~a" i))))])
#`(congame:formular
(haml
(:div
slider-js
(:div
(:div ([:class "slider"])
(kwd
(congame:input-range))
(:span "Value: " (:output ""))) ... )
congame:submit-button))))]))
[(_ n:nat {~optional make-widget-proc-expr:expr})
(with-syntax ([((slider-id kwd) ...)
(build-list
(syntax-e #'n)
(lambda (i)
(list i (string->keyword (format "slider-~a" i)))))])
#`(let ([make-widget-proc {~? make-widget-proc-expr (λ (_) (congame:input-range))}])
(congame:formular
(haml
(:div
slider-js
(:div
(:div
([:class "slider"])
(kwd (make-widget-proc slider-id))
(:span "Value: " (:output ""))) ... )
congame:submit-button)))))]))


;; Multiple Checkboxes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Expand Down

0 comments on commit 5db9282

Please sign in to comment.