original commit: 8a2ae6844ec0ce4ea5b85d9c6a729ffe9fae70a3
This commit is contained in:
Matthew Flatt 2002-07-04 21:15:30 +00:00
parent 11107e4273
commit 234de2586b
2 changed files with 28 additions and 2 deletions

26
collects/mred/doc.txt Normal file
View File

@ -0,0 +1,26 @@
_edit-main.ss_
The edit-main.ss module does not export anything, but invoking the
module opens an _editor_ frame or frames, based on the
`current-command-line-arguments' parameter.
In particular, from a command line
mred -mvqL edit-main.ss <filename> ...
runs a simple editor program. If <filename> is an image file (suffix
.gif, .xpm, .xbm, .bmp, or .jpg), the editor window display the image.
-----------------------------------------------------------------
_edit.ss_
The edit.ss module exports the following function.
> (new-text-frame file)
Creates an editor text frame, initially loading `file' if is it a
string. Supply #f as `file' for an initially empty editor.
> (new-pasteboard-frame file)
Like `new-text-frame', but for a pasteboard editor.

View File

@ -13,7 +13,7 @@
(define (new-pasteboard-frame file) (new-frame pasteboard% file))
(define (new-frame editor% file)
(define f (make-object frame% (or file "Simple Editor") #f 620 450))
(define f (make-object frame% "MrEdIt" #f 620 450))
(define c (make-object editor-canvas% f))
(define e (make-object editor%))
(define mb (make-object menu-bar% f))
@ -56,7 +56,7 @@
(send c set-editor e)
(when file
(if (regexp-match "[.]((gif)|(bmp)|(jpg)|(xbm))$" file)
(if (regexp-match "[.]((gif)|(bmp)|(jpg)|(xbm)|(xpm))$" file)
(send e insert (make-object image-snip% file))
(send e load-file file)))