[plt-scheme] Using mred -z

From: Felix Klock's PLT scheme proxy (pltscheme at pnkfx.org)
Date: Sat Mar 6 15:10:41 EST 2004


According to the documentation for MrEd, starting the mred executable 
with the -z option is supposed to make it accept its input from STDIN 
(and also print to STDOUT), rather than launching a seperate GUI repl.

When I run the following sample program (taken from the start of the 
MrEd documentation) by running "mred -z" at a X11 terminal (OS X) and 
then typing each expression into the terminal REPL, mred pops up a 
window with a button, but clicking the button has no effect.

If I run "mred" on the following expressions without the -z option, 
then clicking the button changes the message text, as expected.

      ;; Make a frame by instantiating the frame% class
      (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, for 
      (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)

Is this the expected behavior for "mred -z" ?

It seems to me that being able to display windows might be useful on 
its own, but I really would like to be able to accept input from the 
user.  Is there some sort of yield type of primitive I need to call 
from the REPL to get the window to accept incoming events?

((Yes, I could clearly just do things without "-z", but bear with 


"Generations of frosh would hail you as
  the most venerable elder of course 6"  -asok

Posted on the users mailing list.