[plt-scheme] Arrows not appearing until mouseover when using "graph.ss" ("mrlib")

From: Stephen De Gabrielle (spdegabrielle at gmail.com)
Date: Wed Jun 13 11:12:57 EDT 2007


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.



-snip of my code-
  (define the-editor-canvas (instantiate editor-canvas%

  (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"
    (define light-pen (send the-pen-list find-or-create-pen "light blue" 1
    (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
University College London Interaction Centre
Remax House - 31/32 Alfred Place
London - WC1E 7DP
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20070613/f45ddd30/attachment.html>

Posted on the users mailing list.