slide not radio

master
Matthew Butterick 5 years ago
parent 57939d301d
commit a0ad665aa6

@ -73,23 +73,27 @@
(make-text-field param str)) (make-text-field param str))
(define current-min-size (make-parameter 3)) (define current-min-size (make-parameter 3))
(define current-max-size (make-parameter 20)) (define current-max-size (make-parameter 24))
(for ([param (list current-min-size current-max-size)] (define length-panel (new horizontal-panel%
[start-size (list (current-min-size) (- (current-max-size) 10))]
[end-size (list (+ (current-min-size) 10) (current-max-size))]
[label-str '("shortest " "longest  ")]
[selected-item (list 0 10)])
(new radio-box%
[parent window] [parent window]
[horiz-margin 6]
[alignment '(left top)]
[stretchable-width #true]
[stretchable-height #false]))
(for ([param (list current-min-size current-max-size)]
[label-str '("word length from" "to")])
(new slider%
[parent length-panel]
[label label-str] [label label-str]
[font app-font] [font app-font]
[horiz-margin 12] [min-value (current-min-size)]
[style '(horizontal)] [max-value (current-max-size)]
[selection selected-item] [init-value (param)]
[choices (map number->string (range start-size (add1 end-size)))] [stretchable-width #t]
[callback (λ (rb evt) [callback (λ (cb evt)
(param (string->number (send rb get-item-label (send rb get-selection)))) (param (send cb get-value))
(refresh-wordbox))])) (refresh-wordbox))]))
(define current-proper-names-choice (make-parameter #f)) (define current-proper-names-choice (make-parameter #f))

Loading…
Cancel
Save