CLIM mail archive

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

Transformations and graphs




I'm trying to apply transformations to graphs that are created with 
format-graph-from-root.  What happens is any text (node labels, for example)
do not get transformed, but everything else does (arcs, borders created with
surrounding-output-with-borders, etc.).  Should it work?

I'm using Allegro CL 4.1 with CLIM 1.1 on a Sparc 1+.  Here's a test program,
loosely based on the example in the manual:


(in-package :clim-user)

(defstruct node
  (name "")
  (children '())
  )

(defvar g1 (let* ((2a (make-node :name "2A"))
		  (2b (make-node :name "2B"))
		  (2c (make-node :name "2C"))
		  (1a (make-node :name "1A" :children (list 2a 2b)))
		  (1b (make-node :name "1B" :children (list 2b 2c))))
	     (make-node :name "0" :children (list 1a 1b))))

(define-application-frame test ()
  ((root :accessor frame-root
	 :initform g1))
  (:panes ((display :application
		    :display-function 'test-graph)
	   (menu :command-menu)) )
  )

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

(defmethod test-graph ((frame test) stream)
  (let ((root (frame-root frame)) )
    (with-translation (stream 100 100)
      (format-graph-from-root 
       root
       #'(lambda (node s)
	   (write-string (node-name node) s))
       #'node-children
       :stream stream)
      )
    ))
			    
When this example is run, the arcs of the graph are translated, while the 
node labels stay in the upper left corner.

Any ideas?

Thanks,
Randy

-- 
Randy A. Coulman                |       ARIES Laboratory
                                |       Department of Computational Science
coulman@cs.Usask.ca             |       University of Saskatchewan
                                |       Saskatoon, SK   S7N 0W0             


Follow-Ups:

Main Index | Thread Index