From: Ciske Busch

Subject: Q: How to remember the FOREGROUND-COLOR of a window / pane with ACL5.0 for Windows NT?

Date: 1999-2-7 15:04

Hi,

how do I find out the currently used foreground-color of a window or a pane?

The GF FOREGROUND-COLOR does not help because it (always?) returns NIL.

Please consider the following example:

(let* ((window (make-window :test
                 :device 'non-refreshing-window))
       (pane (front-window window)))

   (format pane "~%Color Test 1: ~a" (foreground-color pane))   ; 1

   (setf (foreground-color pane) red)                           ; 2
   (format pane "~%Color Test 2: ~a" (foreground-color pane))

   (format pane "~%~%one")                                      ; 3
   (with-foreground-color (pane blue)                           ; 4
     (format pane " two "))
   (format pane "three")                                        ; 5
   )

The example opens a window and in step 1 writes "Color Test 1: NIL" in the
"current" color which is by default black.
In step 2 the color is successfully set to red and so the next line results
in printing "Color Test 2: NIL" in red but note that FOREGROUND-COLOR still
returns NIL, so I can not find out the currently used color with this
method.

WITH-FOREGROUND-COLOR does not help either because

* step 3 prints "one" in red,
* step 4 prints " two " in blue, and
* step 5 prints "three" in black (!)

(By the way: the example shows the same results for a basic-pane.)

So if the pane has a different foreground-color than the
system-foreground-color how do can I restore that color?

Any comments would be appreciated.

ciske



-------------------------------------------------------------------
"Real stupidity beats artificial intelligence every time."
                                               M.Ridcully

Ciske Busch
Lehrstuhl fuer Kuenstliche Intelligenz und Angewandte Informatik
Universitaet Wuerzburg, Germany
http://ki-server.informatik.uni-wuerzburg.de/~ciske/
ICQ: #23765977
-------------------------------------------------------------------