[plt-scheme] Learning to use MrEd

From: Nicholas Chubrich (chubrich at cs.brandeis.edu)
Date: Fri Sep 22 11:08:51 EDT 2006

	I have a little program that has input fields and stores them in a 
list which I will include below.
	I'm right there with you about MrEd documentation.  It is very
frustrating.  Searching in the DrScheme code feels a lot like overkill
when all you want to do is solve a few simple problems.
	I guess this is one of my pet-peeve topics.  Real men, of course,
learn \everything from source-code---I concede.  (Neither do real men
worry about wasted man-hours---virtuous activities can never be a waste,
no matter how unnecessary they are.)  The rest of us might have something
to contribute, at any rate---if only we could have a little more coddling
and hand-holding.  Much as we might like to have an O'Reilly-style guide
to Programming Scheme, however, it isn't going to happen.  It's not the
job of the developers to create this kind of documentation, and it's not a
job anyone is likely to take on in its entirety for the sheer fun of it.
	I have argued before that what we need is a place for incremental,
distributed improvements to the documentation.  The Scheme Cookbook has
its partisans, but my feeling is it is a little too awkward to use, both
on the contribution and the retrieval side.  (If this were the
'Unix-lovers' list, I don't suppose that would be much of an argument.)  
Awkwardness of use matters immensely because we are a small community.  
If nine out of ten people are deterred from using something to share work
they do, that's nine people we don't have.
	Maybe part of the solution is a documentation wiki, but I would
argue that is still too much for what some people would be inclined to do.  
The best I have been able to think of is \annotation---posting examples
\in \association \with the documentation, without having to integrate them
into the flow of the documentation.  If you want to see an example of
this, go to worldforum.dk and then, following the instructions, look at
the forum on the online PLT documentation.  As you can see, it hasn't
caught on.
	There is probably an acceptable solution out there waiting for
someone to stumble on it....One can hope, anyway!

Here is the example code (you press return on each field to enter it into
the list):

(define Field-frame
   (label "Fields")
   (width 400)
   (height 300)
   (x 400)
   (y 10)))

(define one '())
(define two '())
(define db '())
(define (db-put str type)
  (if (eq? type 'one)
      (set! one str)
      (begin (set! two str)
             (print (cons one two))
             (printf "~n")
             (set! db (cons (cons one two) db))
             (print db)
             (printf "~n~n"))))

(define (kallback type)
  (lambda (text-field control-event)
    (if (eq? (send control-event get-event-type) 'text-field-enter)
        (db-put (send text-field get-value) type))))

(define field-one
   (parent Field-frame)
   (label "One")
   (callback (kallback 'one))))

(define field-two
   (parent Field-frame)
   (label "Two")
   (callback (kallback 'two))))

(send Field-frame show #t)

On Fri, 22 Sep 2006, David Gurvich wrote:

> In trying to learn how MrEd is used, I have run into a problem with the 
> documentation.  The introduction is quite good and has good examples of how 
> to create a frame and buttons, but for the rest I've understood better by 
> searching the drscheme source code.
> Does anyone have short examples that show an input field and/or highlighting 
> and right-click pop-up menus? 
> -- 
> *--*--*--*--*--*--*--*--*--*--*--*
> KMail on Gentoo/PPC
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.