
12.4 Examples of Menus and Dialogs in CLIM
If you build CLIM dialogs using accepting-values, you can achieve this effect by using the :resynchronize-every-pass argument to accepting-values in conjunction with the :default argument to accept. There are three points to remember:
Min andMax, but we wish to allow the user to supply aMin that is greater than theMax, and automatically exchange the values rather than signalling an error.
(defun accepting-interval (&key (min -1.0) (max 1.0)
(stream *query-io*))
(clim:accepting-values (stream :resynchronize-every-pass t)
(fresh-line stream)
(setq min
(clim:accept
'clim:real :default min
:prompt "Min" :stream stream))
(fresh-line stream)
(setq max
(clim:accept
'clim:real :default max
:prompt "Max" :stream stream))
(when (< max min)
(rotatef min max)))
(values min max))
(You may want to try this example after dropping the :resynchronize-every-pass and see the behavior. Without :resynchronize-every-pass, the constraint is still enforced, but the display lags behind the values and doesn't reflect the updated values immediately.)

Generated with Harlequin WebMaker