CLIM mail archive

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

draw-icon



	  I'm looking for a working example of draw-icon* that uses make-pattern
    to make the bitmap.  If anyone has this, could they send it to me?

	  Thanks,

	     Erik Eilerts
	     University of Texas at Austin
	     eilerts@cs.utexas.edu


Here you go.
James Lawton
Rome Laboratory

;;///////////////////////////  cut here \\\\\\\\\\\\\\\\\\\\\\\\\\\
;;; -*- Mode: LISP; Syntax: Common-lisp; Package: USER; Base: 10 -*-

;; Below is a short segment of code that
;; draws an 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>.


(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 (com-exit :menu t :name "exit") ()
  (clim::frame-exit clim::*application-frame*))



0,,

References:

Main Index | Thread Index