Subject: [clisp-list] Problems with new-clx xlib:put-image

From: Barry Fishman <[email-masked]>
Date: Sat Sep 20 06:01:03 2003

Since the last CVS code reorganization my calls to xlib:put-image,
using the new-clx module, do not seem to display the image correctly.
My code works with previous CVS snapshots and with cmu lisp.

I am using SuSE Linux 8.1.  For example, the gremblin X bitmap (under
SuSE) /usr/X11R6/include/X11/bitmaps/m-grelb.xbm.

Reading it with:
    (setf *gremblin* (or (xlib:read-bitmap-file bmfile)
                         (error "Cannot read bitmap file: ~A~%" bmfile))))

I get the structure (as before)

#S(XLIB:IMAGE-X :WIDTH 40 :HEIGHT 44 :DEPTH 1 :PLIST (:NAME :M-GRELB)
   :FORMAT :Z-PIXMAP :BYTES-PER-LINE 8 :BITS-PER-PIXEL 1 :BIT-LSB-FIRST-P T
   :BYTE-LSB-FIRST-P T
   :DATA
   #(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     0 0 0 128 31 0 240 3 0 0 0 64 48 0 24 4 0 0 0 0 32 255 9 0 0 0 0 0 224 255
     15 0 0 0 0 0 248 255 63 0 0 0 0 0 254 255 255 0 0 0 0 0 255 255 255 1 0 0
     0 128 255 255 255 3 0 0 0 128 255 255 255 3 0 0 0 192 31 255 241 7 0 0 0
     192 15 254 224 7 0 0 0 192 15 254 224 7 0 0 0 192 31 255 241 7 0 0 0 192
     255 255 255 7 0 0 0 128 255 255 255 3 0 0 0 128 255 255 255 3 0 0 0 0 255
     255 255 1 0 0 0 0 254 255 255 0 0 0 0 0 248 255 63 0 0 0 0 0 224 255 15 0
     0 0 0 0 0 255 1 0 0 0 0 0 0 199 1 0 0 0 0 0 0 198 0 0 0 0 0 0 0 198 0 0 0
     0 0 0 0 198 0 0 0 0 0 0 0 198 0 0 0 0 0 0 0 130 0 0 0 0 0 0 0 130 0 0 0 0
     0 0 0 130 0 0 0 0 0 0 0 130 0 0 0 0 0 0 0 130 0 0 0 0 0 0 254 131 255 0 0
     0 0 0 255 199 255 1 0 0 0 0 254 131 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
   :UNIT 32 :PAD 32 :LEFT-PAD 0)

When I try to display it with:

(defun show-image (win gcon image)
  "Display image.  Called on exposure events."
  ;; (format t "-- Exposure --~%")
  (xlib:put-image win gcon image :x 0 :y 0
                  :width (xlib:image-width image)
                  :height (xlib:image-height image)
                  :bitmap-p t)
  (xlib:display-force-output *display*))

I get the right edge of the gremblin along the left edge of the
window, the left edge of the gremblin along the right edge of the
window, and just space in-between.

The window is the same size as the bitmap, but resizing the window
does not effect the image displayed.

I have a short test program (105 lines) and the x bitmap file,
which I can supply upon request.