[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

No-compute screensaver

Thanks to all those who have sent suggestions and/or code for a "no-
-compute" screensaver. I've been following a suggestion first received
from Rich Lynch at ILS, to just create a big black window that covers
the entire screen. In addition, I'm using a "common hack" of setting
foreground and background on the menubar to black. (Since I'm the only
one using my machine, this is ok, even though as someone pointed out,
it isn't within Mac UI standards...)

This approach is exactly what I need, because at any point in time while
my application is running I can grab the black window interactively, and
resize it to see what's happening in the Lisp Listener, then resize it to
fill the entire screen again. And, as a screensaver, it doesn't use up an
y cpu cycles-- (I disable my conventional screensaver by hand before 
doing anything else, so it's not a problem.)

There are still a few flaws, namely the following icons remain displayed
on the screen: 1) for the black window, the double square at the bottom
right corner, used for resizing the window; 2) for the menubar, the apple
icon, the balloon help icon, and the current application icon at the far
right of the menubar. If anyone can suggest how to black these out and
restore them, I'd appreciate it -- I do plan to try all the code that's
been sent to me, and perhaps also hack around a bit more on my own... So,
perhaps I've already received the solution.

FYI, here's the code I'm currently using:

;;; -*- Syntax:Common-LISP; Mode:LISP; Package: Common-Lisp-User; Base:10. -*-

; history

; PCJ 3/26/94  created file, to make a simple, no compute screensaver.
;              this works, except that the following items remain displayed on
;              the screen: 1) on the screensaver window, the "double-square"
;              in the lower right corner of the window, used for resizing the
;              window; and 2) in the menubar, the apple icon, the balloon help icon,
;              and the current-applications icon (at the far right).
;              it will take more work to make these go away, and also restore them.

(defvar *screensaver*)

(defclass screensaver (window)
    :window-type :document

(defun init-screensaver ()
  (let (window)
    (setf window
          (make-instance 'screensaver
            :view-position #@(0 0)
            :view-size (make-point *screen-width* *screen-height*)
            :window-show nil
    (set-fore-color window *black-color*)
    (set-back-color window *black-color* t)
    (set-part-color window :frame *black-color*)
    (set-part-color window :text *black-color*)
    (set-part-color window :hilite *black-color*)
    (set-part-color window :title-bar *black-color*)

(defun save-screen ()
  (let ()
    (setf *screensaver* (init-screensaver))
    (window-show *screensaver*)
    (set-part-color *menubar* :menubar *black-color*)

(defun ss () (save-screen))

(defun restore-screen ()
  (set-part-color *menubar* :menubar *white-color*)
  (setf *screensaver* (window-close *screensaver*))

(defun rs () (restore-screen))