[pal-cvs] CVS pal-gui/examples

tneste tneste at common-lisp.net
Tue Oct 16 21:46:09 UTC 2007


Update of /project/pal/cvsroot/pal-gui/examples
In directory clnet:/tmp/cvs-serv9325/examples

Modified Files:
	test.lisp 
Log Message:
Several fixes, mostly in widget packing.

--- /project/pal/cvsroot/pal-gui/examples/test.lisp	2007/10/16 00:16:41	1.4
+++ /project/pal/cvsroot/pal-gui/examples/test.lisp	2007/10/16 21:46:09	1.5
@@ -5,22 +5,35 @@
 
 (defun test ()
   (with-gui (:paths (merge-pathnames "examples/" pal::*pal-directory*))
-    (let* ((window (make-instance 'window :pos (v 200 200) :width 300 :height 200))
+    (let* ((window (make-instance 'window :pos (v 200 200) :width 300 :height 230))
            (window-2 (make-instance 'window :width 200 :height 300))
-           (cont (make-instance 'h-container :parent window))
-           (cont-2 (make-instance 'v-container :parent cont))
-           (meter (make-instance 'h-meter :parent cont :max-value 80 :display-fn (lambda (v) (format nil "FPS: ~a" v))))
-           (gauge (make-instance 'h-gauge :parent cont-2
-                                          :min-value 0 :max-value 255 :value 0 :display-fn (lambda (v) (format nil "R: ~a" v))))
-           (button (make-instance 'button :value "FooBar!"  :parent cont-2 :on-select (lambda (g pos) (message 'foo) t)))
-           (button (make-instance 'button :value "List"  :parent window-2 :on-select (lambda (g pos) (message 'foo) t)))
-           (list (make-instance 'list-box :parent window-2 :items (loop for i from 0 to 100 collect (format nil "FooBar ~a" i)))))
+
+           (box (make-instance 'h-box :parent window))
+           (right-box (make-instance 'v-box :parent box))
+           (left-box (make-instance 'v-box :parent box))
+           (bottom-box (make-instance 'v-box :parent window))
+
+           (meter (make-instance 'h-meter :parent right-box :max-value 80 :display-fn (lambda (v) (format nil "FPS: ~a" v))))
+           (rg (make-instance 'h-gauge :parent left-box
+                                       :min-value 0 :max-value 255 :value 0 :display-fn (lambda (v) (format nil "R: ~a" v))))
+           (gg (make-instance 'h-gauge :parent left-box
+                                       :min-value 0 :max-value 255 :value 0 :display-fn (lambda (v) (format nil "G: ~a" v))))
+           (bg (make-instance 'h-gauge :parent left-box
+                                       :min-value 0 :max-value 255 :value 0 :display-fn (lambda (v) (format nil "B: ~a" v))))
+           (ag (make-instance 'h-gauge :parent left-box
+                                       :min-value 0 :max-value 255 :value 0 :display-fn (lambda (v) (format nil "A: ~a" v))))
+           (list (make-instance 'list-box :parent window-2 :items (loop for i from 0 to 100 collect (format nil "FooBar ~a" i))))
+           (button (make-instance 'button :value "FooBar!"  :parent window-2 :on-select (lambda (g pos) (message 'foo) t)))
+           )
+
+      (make-instance 'button :value "Button" :parent bottom-box)
 
       (gui-loop ()
         (setf (value-of meter) (get-fps))
         (draw-image* (tag 'tile) (v 0 0) (v 0 0) 800 600)
-        (with-blend (:color (list (value-of gauge) 0 0 64))
+        (with-blend (:color '(0 0 0 64))
           (draw-image (tag 'plane) (v 320 220)))
-        (draw-image (tag 'plane) (v 300 200))))))
+        (with-blend (:color (list (value-of rg) (value-of gg) (value-of bg) (value-of ag)))
+          (draw-image (tag 'plane) (v 300 200)))))))
 
 ;; (test)
\ No newline at end of file




More information about the Pal-cvs mailing list