CLIM mail archive

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

Problem with clim:draw-icon



;;; -*- Mode: LISP; Syntax: Common-lisp; Package: USER; Base: 10 -*-

;; Ok, folks, you say you want to hear our problems?  Well just when 
;; you thought it was save to back on the network . . .
;; 
;; But seriously, I do have a real problem.  It is with the "clim:draw-icon"
;; function.  As I understood it (from the class I took from Symbolics) this
;; function is supposed to basically do a bitblt of the pattern you give
;; it at the coordinates you give it.  However, it tends to get the pattern
;; all mish-mashed.  As an example, below is a short segment of code that
;; tries to draw my airplane glyph somewhere on the on a display pane.
;; To try it, load it into either Genera or Allegro CL (with CLIM loaded, 
;; of course).  For Allegro, run "(start)".  For Genera, type <select>-<circle>.

;; I have a call in to Symbolics Software support, but its been over 2 weeks
;; now with no solution.  I am running out of options ;-).



(clim::define-application-frame test-frame ()
    ()
  (:panes ((display :application)
	   (interactor :interactor)))
  (:layout ((main (:column :rest
		   (display 0.80)
		   (interactor :rest))))
	   ))

#+allegro
(defvar *main-screen* (clim::open-root-window :clx))
#+allegro
(defvar *test-frame* (clim::make-application-frame 'test-frame
						   :parent *main-screen*
		  				   :top 100
						   :left 100
						   :width 800
						   :height 600))
#+allegro
(defun start ()
  (clim::run-frame-top-level *test-frame*))

#+symbolics
(clim:define-genera-application test-frame :select-key #\square)


(defun stream-of (pane-name)
  (clim::get-frame-pane clim::*application-frame* pane-name))



(define-test-frame-command (com-erase :name "Erase") ()
  (clim::window-clear (stream-of 'display)))



(defvar AIRFONT-glyph-0 (clim::make-pattern
			 #2A((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 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 0 0 0 0 0 0 0 0)
			     (0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
			     (0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
			     (0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
			     (0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
			     (1 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
			     (1 1 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0)
			     (1 1 1 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0)
			     (1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0)
			     (1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1)
			     (1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0)
			     (1 1 1 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0)
			     (1 1 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0)
			     (1 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
			     (0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
			     (0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
			     (0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
			     (0 0 0 0 0 1 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 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 0 0)
			     )
			 (list clim::+background+ clim::+foreground+)))


(define-test-frame-command (draw-glyph :name "Draw Glyph")
    ((x '(integer 0 800))
     (y '(integer 0 600)))
  (clim::draw-icon (stream-of 'display) AIRFONT-glyph-0 x y))


(define-test-frame-command (exit :menu t :name "exit") ()
  (clim::frame-exit clim::*application-frame*))

(define-test-frame-command (draw-glyph :name "Draw Glyph")
    ((x '(integer 0 800))
     (y '(integer 0 600)))
  (clim::draw-icon (stream-of 'display) AIRFONT-glyph-0 x y))

0,,

Follow-Ups:

Main Index | Thread Index