> Hi Jon,
>
> Question #1. First, there is a problem with the proliferation of graph
> views. I would like
> to do the following. A graph view would be generated. A message window
>
> would appear telling the user to strike any key to continue. After
> observing
> the graph view for a time, the user would strike a key, causing both the
> graph
> view and the message window to disappear. I know how to produce both
> the graph
> view and the message window. It is getting them to disappear on key, so
> to
> speak, that has eluded me. As for the graph view itself, I will want to
> be
> able update it subsequently. So it is not a matter of destroying it as
> an
> object. My problem is only that I currently am looking at all of the
> updates,
> whereas I want only the most recent one.
You can get access to and get rid of the top level window in which the
graph view resides like this:
(define gt (slot-ref (current-graph-view) 'graph-toplevel))
(destroy gt)
You should be able to incorporate this into your plan somehow.
> Question #2. I am not getting color but, rather, just gray-scaling. Is
> there
> something I need to do first to initialize coloring?
I'm not sure what is going on here. When I download LINK for Windows from
DIMACS and put up a vertex, it's blue. Does your application seem to turn
off colors that are there when you run Link and put up a vertex?
> Question #3. At a given point in the simulation,
> I have three red edges within a grid. A message appears on the screen
> inviting
> the user to click on one of the three edges (see prompt below). I would
> like
> to assign the selected edge to a variable selected-edge and then recolor
> things.
> I have attempted the assignment with
>
> let* (
> (selected-edge (select-edges gv))
> ...
> )
>
> But I doubt that I have the semantics of select-edges right. Most
> likely, it
> is returning a list of all edges rather than a single selected edge. Is
> there some
> way to do what I am trying to do? If not, I can use radio buttons to
> make the
> assignment, I suppose.
The variable *link:selected-edge-items* refers to a list of the currently
selected edge-items. This may well be beyond the documentation curve, for
which I apologize.
> ; This function extends the optimal alignment path by one edge. Since
> the
> ; path is being reconstructed from bottom right to upper left, this
> means
> ; that a single edge (horizontal, diagonal, or vertical) will be added
> at
> ; the front of the path.
> (define (extend-path-by-one-edge vi gv num-rows num-cols)
> (let* (
> (e1 (edge-from-left vi (edges gv) gv))
> (e2 (edge-from-above-left vi (edges gv) gv num-cols))
> (e3 (edge-from-above vi (edges gv) gv num-cols))
> (prompt "Click on a red edge so as to extend the path from lower
> right to upper left.\n The selected edge should be such that
> source-value + edge-weight = target-value")
> )
> (set! (color e1) "red")
> (set! (color e2) "red")
> (set! (color e3) "red")
> (update-labels-and-generate-message-window prompt gv)
> (let* (
> ***** (selected-edge (select-edges gv))
> (verts-of-e (vertices (edge selected-edge)))
> (source (ref verts-of-e 0))
> )
> (set! (color e1) *link:default-edge-color*)
> (set! (color e2) *link:default-edge-color*)
> (set! (color e3) *link:default-edge-color*)
> (set! (color selected-edge) "cyan")
> (set! vi source)
> )
> )
> )
>
> I think that the simulation will be pretty good once it is all
> finished. Although he has been a fair amount of work, certain things
> turned out to be very easy--in particular, data entry boxes. Thank you
> for making that so easy. Will you be at Rutgers this summer?
>
> My best,
>
> Greg Taylor
>
>
It sounds like a non-trivial simulation, and I am very happy that you took
up the challenge.
I won't be at DIMACS this summer, but one of my students from last summer
(Jaya Paliwal) will be there working on her simulation.
regards,
Jon Berry