[previous] [up] [next]     [contents] [index]
Next: MrEd Collections Up: Writing Complete Applications Previous: Unitized Applications

Non-unitized Applications

If your application consists of various top-level defines, and does not use units, you can use the non-unitized startup approach, although the unitized approach is reccommended. You must pass the -u flag to mred. After that flag is passed, use the -f flag to load files, e.g., mred -u - -f filename.ss, or the -e flag to evaluate expressions, e.g., mred -u - -e scheme-expr.

Your file should define mred:startup to be a function that accepts multiple arguments, all strings, representing the command line arguments and starts your application.

The initial language will have loaded the core.ss and cmdline.ss libraries from MzLib and the wx: mred: names described in this manual.

If you want to use mred in a shell script, this is a template sh script that starts up MrEd with the usual console:

 
#!/bin/sh

string=? ; exec mred -u -- -f $0 "$@"

(define mred:startup
  (lambda cmd-line-args
    (make-object mred:console%)))

After the string=? line, you can include any scheme code required to load your application. Also, consider using the -p flag to specify a splash screen, or the -b flag to turn off the splash screen. See the splash screen section for more info.

The default mred:startup ignores it's arguments and opens a frame with a quit button.



PLT