[plt-scheme] Arrows not appearing until mouseover when using "graph.ss" ("mrlib")
I'm not sure, this may count as a bug in the graph library, but the
editor canvas is not refreshed when `connect' is called. You can
refresh it youself, by adding this line at the end of your program:
(send the-editor-canvas refresh)
Robby
On 6/13/07, Stephen De Gabrielle <spdegabrielle at gmail.com> wrote:
> Hi,
>
> I've got a weird problem that the arrows not appearing when I draw a graph.
>
> They appear, though not fully when I mouseover a node.
>
> As graph.ss seems to work fine with the module browser, I'm guessing I've
> done something wrong - Does anyone have any hints?
>
> I have some sample code below.
>
> Cheers,
>
> Stephen
>
> -snip of my code-
> (define the-editor-canvas (instantiate editor-canvas%
> (the-vertical-pane)))
>
> (define the-graph-pasteboard (instantiate (graph-pasteboard-mixin
> pasteboard:basic%) ()))
> (send the-editor-canvas set-editor the-graph-pasteboard)
>
> (define my-graph-snip% (graph-snip-mixin string-snip%))
>
> (define (connect parent child)
> (define dark-pen (send the-pen-list find-or-create-pen "blue" 1 'solid))
> (define dark-brush (send the-brush-list find-or-create-brush "blue"
> 'solid))
> (define light-pen (send the-pen-list find-or-create-pen "light blue" 1
> 'solid))
> (define light-brush (send the-brush-list find-or-create-brush "light
> blue" 'solid))
> (add-links parent child
> dark-pen light-pen
> dark-brush light-brush))
>
> (define aaa (make-object my-graph-snip% "aaa"))
> (define bbb (make-object my-graph-snip% "bbb"))
> (define ccc (make-object my-graph-snip% "ccc"))
> (define ddd (make-object my-graph-snip% "ddd"))
>
> (send the-graph-pasteboard insert aaa)
> (send the-graph-pasteboard insert bbb)
> (send the-graph-pasteboard insert ccc)
> (send the-graph-pasteboard insert ddd)
>
> (send the-the-frame show #t)
>
> (define-values (width height) (send the-editor-canvas get-client-size))
>
> (printf "width:~a height:~a" width height)
> (define (random-position extent)
> (+ 30 (random (- extent 60)))
> )
> (send the-graph-pasteboard move-to aaa (random-position width) (+ 30
> (random (- height 60))))
> (send the-graph-pasteboard move-to bbb (+ 30 (random (- width 60))) (+ 30
> (random (- height 60))))
> (send the-graph-pasteboard move-to ccc (+ 30 (random (- width 60))) (+ 30
> (random (- height 60))))
> (send the-graph-pasteboard move-to ddd (+ 30 (random (- width 60))) (+ 30
> (random (- height 60))))
> (connect aaa bbb)
> (connect ccc bbb)
> (connect ddd bbb)
> (connect aaa ddd)
>
>
> --
> Stephen De Gabrielle
> s.degabrielle at ucl.ac.uk
> Telephone +44 (0)20 7679 5242 (x45242)
> Mobile 079 851 890 45
> http://www.uclic.ucl.ac.uk/annb/MaSI.html
> University College London Interaction Centre
> Remax House - 31/32 Alfred Place
> London - WC1E 7DP
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>