Add procedure to restore focus to the editor's screen.
authorChris Hanson <org/chris-hanson/cph>
Wed, 2 Sep 1992 03:18:45 +0000 (03:18 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 2 Sep 1992 03:18:45 +0000 (03:18 +0000)
v7/src/6001/edextra.scm
v7/src/6001/picture.scm

index 75408e5078e20c0b22791cc1595696d6d3ac565a..f7c645bb6381240f79d7c897dd50d6140aa0b9c7 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/6001/edextra.scm,v 1.4 1992/09/02 02:56:36 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/6001/edextra.scm,v 1.5 1992/09/02 03:17:58 cph Exp $
 
 Copyright (c) 1992 Massachusetts Institute of Technology
 
@@ -41,20 +41,30 @@ MIT in each case. |#
 (define-command print-graphics
   "Print out the last displayed picture."
   '()
-  (let ((call-with-last-picture-file
-        (environment-lookup (->environment '(student pictures))
-                            'call-with-last-picture-file)))
-    (lambda ()
-      (call-with-last-picture-file
-       (lambda (filename)
-        (if filename
-            (begin
-              (message "Spooling...")
-              (shell-command
-               false false false false
-               (string-append "/users/u6001/bin/print-pgm.sh "
-                              filename
-                              " "
-                              (print/assemble-switches "Scheme Picture" '())))
-              (append-message "done"))
-            (editor-error "No picture to print!")))))))
\ No newline at end of file
+  (lambda ()
+    (call-with-last-picture-file
+     (lambda (filename)
+       (if filename
+          (begin
+            (message "Spooling...")
+            (shell-command
+             false false false false
+             (string-append "/users/u6001/bin/print-pgm.sh "
+                            filename
+                            " "
+                            (print/assemble-switches "Scheme Picture" '())))
+            (append-message "done"))
+          (editor-error "No picture to print!"))))))
+
+(environment-link-name '(edwin)
+                      '(student pictures)
+                      'call-with-last-picture-file)
+
+(define (restore-focus-to-editor)
+  (let ((screen (selected-screen)))
+    (if (xterm-screen/grab-focus! screen)
+       (xterm-screen/flush! screen))))
+
+(environment-link-name '(student pictures)
+                      '(edwin)
+                      'restore-focus-to-editor)
\ No newline at end of file
index 6bd7a6d54a69f097b797dcd23f17c8f48d49f4f9..9ff10e49b4a0009521e517b79cc3748f43802163 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/6001/picture.scm,v 1.16 1992/09/01 22:41:37 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/6001/picture.scm,v 1.17 1992/09/02 03:18:45 cph Exp $
 
 Copyright (c) 1991-92 Massachusetts Institute of Technology
 
@@ -90,6 +90,7 @@ MIT in each case. |#
     (x-graphics/flush window)
     (if (not (n-gray-map window))
        (allocate-grays window))
+    (restore-focus-to-editor)
     window))
 
 (define (n-gray-map window)