Re: Graph views

Jonathan Berry (berryj@elon.edu)
Sun, 6 Jun 1999 19:04:05 -0400 (EDT)


On Sun, 6 Jun 1999, Gregory Taylor wrote:

> Hi Jon,
>
> I am just focusing on my problem with the proliferation of graph views
> and starting small. This
> is how my top-level function starts out.
>
>
> (let* (
> ...
> (gv '())
> )
> (1) (set! dg (create-digraph ... ))
> (2) (set! gv (show-graph dg))
> (3) (create-grid-layout-and-introduce-title gv ...)
>

I looked around in graph-view.stklos, and the replace-graph function
should help. It replaces the graph in a graph-view without creating a new
window (graph-toplevel). For example:

(define (my-layout gv)
(circle-layout* (graph gv) gv) ;; or whatever
)

(define dg (create-digraph....))
(define (put-in-existing-window g gv)
(replace-graph (copy-graph g 1) gv) ; 1 means "copy attributes"
(my-layout gv)
)


> I have tried using your suggestion
>
> (define gt (slot-ref (current-graph-view) 'graph-toplevel))
> (destroy gt)

Was it a problem with confusing gv with (current-graph-view)?

> Also, intuitively, what is the
> graph-toplevel slot of a graph
> view?

It's the window itself -- a frame that includes the menu bar and the
graph-canvas (the white field).

I hope this helps.
Jon