I have a problem while trying to draw a canvas GUI element.
I create a frame, canvas and try to draw the context of the canvas context using the method draw-line, but nothing happens. A canvas frame is displayed, but the line is not displayed on the canvas.
(require racket/gui/base)
(define frame (new frame% [label "Frame"] [width 500] [height 500]))
(define canvas (new canvas% [parent frame]))
(define dc (send canvas get-dc))
(send dc draw-line 10 10 200 200)
(send frame show
Does anyone know where I am mistaken in the code above?
source
share