[racket] drawing on canvas what's wrong with my code?
drawing on canvas what's wrong with my code?
I coded as follow and run it but nothing apear.
could sombody tell me what's wrong with my code?
#lang scheme/gui
(require 2htdp/image)
(define pic dc<%>)
(define f (instantiate frame% ("map editor")))
(define mcan%
(class canvas%
(override on-event)
(define on-event (λ (e)
(send msg set-label
(string-append (number->string (send e get-x)) " "
(number->string (send e get-y))))))
(super-instantiate ())))
(define mcan (new mcan% (parent f) (min-width 400) (min-height 400)))
(send (send mcan get-dc) draw-bitmap (make-object bitmap% "town.png"
'png) 16 16)
(define msg (instantiate message% ("nothing so far" f)))
(send f show #t)