Re: CAPI question: selectable edges
Hi
it is three years since I sent this message... I did some workaround in the meantime, but now I really need to "get it right" (TM).
The problem is exemplified by the following piece of code that comes with the CAPI examples.
(in-package "CL-USER")
(defun test-labelled-graph-edges (&optional (direction :left-right))
(capi:contain
(make-instance 'capi:graph-pane
:roots '(1)
:layout-function direction
:edges-selectable-p t ; <== CHECK THIS.
:children-function
#'(lambda(x)
(when (< x 10)
(list (* x 2) (1+ (* x 2)))))
:edge-pane-function
#'(lambda(self from to)
(declare (ignore self))
(let ((use-arrow (zerop (mod from 2)))
(use-label (zerop (mod to 2))))
(apply
'make-instance
(if use-arrow
(if use-label
'capi:labelled-arrow-pinboard-object
'capi:arrow-pinboard-object)
(if use-label
'capi:labelled-line-pinboard-object
'capi:line-pinboard-object))
(when use-label
(list :data (format nil "From ~R to ~R" from to))))))
:interaction :extended-selection)
:best-width 700
:best-height 700))
On LWM (and LWW) selecting the edge highlights the whole bounding rectangle. Instead, I want to redraw the arrow or line in green.
Some time ago I did a lot of digging, but that was in 4.3.x and came to the conclusion that the only way to fix this would be to completely re-implement lines and arrow pinboard objects. Is there a better way dealing using the highlighting methods?
Cheers
--
Marco
On Jun 10, 2005, at 02:27 , Marco Antoniotti wrote:
Hi
I have a graph pane with selectable edges. The semantics is fine, but the visuals are not so nice. Essentially, when selected the whole bounding box of the edge is redisplayed in reverse.
Is there a way to just "highlight" the edge instead?
Thanks
--
Marco Antoniotti
http://bioinformatics.nyu.eduNYU Courant Bioinformatics Group
tel. +1 - 212 - 998 3488
715 Broadway 10th FL
fax. +1 - 212 - 998 3484
New York, NY, 10003, U.S.A.