[racket] GUI: text field on a canvas

From: Dmitry Pavlov (dpavlov at ipa.nw.ru)
Date: Fri Jul 18 03:34:43 EDT 2014

Matthew,

> To get rid of the 5 pixels, you want to set the "inset", not the
> "margin". See `vertical-inset` and `horizontal-inset` in `editor-canvas%`.

Thanks, it worked!

Robby,

>> You can put the text% object directly into the editor-canvas if you want.

Err, how do I do that? I just tried

(require racket/gui)
(define frame (new frame% (label "Test")))
(define pasteboard (new pasteboard%))
(define editor-canvas
  (new editor-canvas%
       (editor pasteboard)
       (parent frame)
       (style '(no-border no-hscroll no-vscroll))))
(define t (new text%))
(send pasteboard insert t 0 0)
(send frame resize 100 100)
(send frame show #t)

and got

insert in pasteboard%: bad argument combination: (object:text% ...) 0 0


Best regards,

Dmitry

Posted on the users mailing list.