Lisp HUG Maillist Archive

DRAW-INVERTED-PINBOARD-OBJECT dies when object has custom background and foreground

Hi does anybody have a workaround for this?

======================================================================== 
===============
(defun make-colored-node (gp item)
   (make-instance 'capi:expandable-item-pinboard-object
                  :text (format nil "~A" item)))

(defun children-f (i)
   (when (< i 20)
     (list (* i 2)
           (1+ (* i 2)))))

(defparameter gp (capi:contain (make-instance 'capi:graph-pane
                                               :visible-min-width 300
                                               :visible-min-height 300
                                               :node-pane-function
'make-colored-node
                                               :roots '(1 2 3 42)
                                               :children-function
'children-f
                                               )))


(defun modify-colors (gp)
   (let ((vs (capi:graph-pane-nodes gp)))
     (dolist (v vs)
       (let ((e (capi:graph-object-element v))
             (o (capi:graph-object-object v))
             )
         (when (oddp o)
           (setf (capi:pinboard-object-graphics-arg e :background)
:cyan))))))

======================================================================== 
===============

Evaluate the code and then issue

	(modify-colors gp)

at the listener.

If you select (collapse or expand) a EVENP node everything works as  
expected.
If you select (collapse or expand) a ODDP node  
DRAW-INVERTED-PINBOARD-OBJECT dies badly.

I need a way to color the nodes while keeping the expand/collapse of  
the nodes in the graph pane working.
This is a show-stopper for me now.

Cheers

--
Marco Antoniotti					http://bioinformatics.nyu.edu/~marcoxa
NYU Courant Bioinformatics Group		tel. +1 - 212 - 998 3488
715 Broadway 10th FL				fax. +1 - 212 - 998 3484
New York, NY, 10003, U.S.A.


Re: DRAW-INVERTED-PINBOARD-OBJECT dies when object has custom background and foreground

Hello Marco,

| Hi does anybody have a workaround for this?
| ===============
| (defun make-colored-node (gp item)
|    (make-instance 'capi:expandable-item-pinboard-object
|                   :text (format nil "~A" item)))
|
| (defun children-f (i)
|    (when (< i 20)
|      (list (* i 2)
|            (1+ (* i 2)))))
|
| (defparameter gp (capi:contain (make-instance 'capi:graph-pane
|                                                :visible-min-width 300
|                                                :visible-min-height 300
|                                                :node-pane-function
| 'make-colored-node
|                                                :roots '(1 2 3 42)
|                                                :children-function
| 'children-f
|                                                )))
|
|
| (defun modify-colors (gp)
|    (let ((vs (capi:graph-pane-nodes gp)))
|      (dolist (v vs)
|        (let ((e (capi:graph-object-element v))
|              (o (capi:graph-object-object v))
|              )
|          (when (oddp o)
|            (setf (capi:pinboard-object-graphics-arg e :background)
| :cyan))))))
|
| ===============
|
| Evaluate the code and then issue
|
|  (modify-colors gp)
|
| at the listener.
|
| If you select (collapse or expand) a EVENP node everything works as
| expected.
| If you select (collapse or expand) a ODDP node
| DRAW-INVERTED-PINBOARD-OBJECT dies badly.
|
| I need a way to color the nodes while keeping the expand/collapse of
| the nodes in the graph pane working.
| This is a show-stopper for me now.

I confirm that this does signal on LWW 4.4.6 and also would like to get the
patch.

Setting foreground instead of background seems to work for me.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru


Updated at: 2020-12-10 08:49 UTC