[racket] Puzzled

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Mon Apr 2 16:37:11 EDT 2012

The following program shows a slider.
Why does the slider stop working, when I uncomment the display line?

#lang racket
(require racket/gui)

(define integer-slider%
  (class* slider% ()
    (inherit get-value)
    (define down? #f)
    (define/override (on-subwindow-event receiver event)
        (super on-subwindow-event receiver event)
        ; (display (get-value)) (display " ")

(define frame (new frame% [label "Example: How to use real-slider%"]))
(define real-slider
  (new integer-slider%
       [parent frame] [label "x:"]
       [min-value 1] [max-value 100] [init-value 50]))

(send frame show #t)

Jens Axel Søgaard

Posted on the users mailing list.