[plt-scheme] mred + emacs

From: knubee (knubee at gmail.com)
Date: Sat Jun 3 16:38:48 EDT 2006

> Jens Axel Søgaard wrote:
> Use the lang collection.

So now I am trying to work my way through the mred manual. Within
emacs, I added (require (lib "plt-pretty-big.ss" "lang")) and started
to do the examples in chapter 2. But quickly had troubles ...

Within drscheme, with language set to Graphical, the following code
does the right thing (according to mred manual): opens a small window
with message and button.

(define frame (instantiate frame% ("Example")))

;; Make a static text message in the frame
(define msg (instantiate message% ("No events so far..." frame)))

;; Make a button in the frame (using keyword-based arguments)
(instantiate button% () (label "Click Me") (parent frame)
             ;; Callback procedure for a button click
             (callback (lambda (button event)
                           (send msg set-label "Button click"))))

;; Show the frame by calling its show method
(send frame show #t)

But I get different behavior running mred through emacs -- even if I
include (require (lib "plt-pretty-big.ss" "lang"))

Rather, the result is: a window with the correct title -- but no
message, no button.

Not only that, but windows created via mred in emacs cannot be closed
by clicking on the standard "close window" element (the "X").

 I have also tried (require (lib "plt-mred.ss" "lang")) -- with the
same results.

I had assumed that including the mred library from within emacs would give
me the same access to its functionality as going via drscheme. What am
I missing?

Note: the following works fine from within emacs -- for display and
closing the window:

(require (lib "htdp-advanced.ss" "lang"))
(require (lib "draw.ss" "htdp"))
(start 300 300)
(draw-solid-disk (make-posn 100 50) 10 'red)

So perhaps there is something else I need to require to get the mred
toolbox to work?


Posted on the users mailing list.