CLIM mail archive

[Prev][Next][Index][Thread]

Problem with (incremental) redisplay of line-output-record-elements.



We have encountered a problem that involves incremental redisplay
of lines and the line-output-record-element.  The purpose of the
application code is to redisplay a node in a directed graph only
if the list of edges leading from the node to other nodes has
changed since the display function was last run.  The error (see
below) is an incorrect list of arguments to the REDISPLAY-1
generic function for a line-output-record-element created by the
edge presentation method, which uses DRAW-LINE*.

The display function and the error message are shown below.  The same
error occurs on redisplay whether or not the presentation of the edges
falls within the scope of the UPDATING-OUTPUT macro, so the problem
doesn't seem to directly involve that macro.  No error occurs for the
node presentations, which are done using DRAW-CIRCLE.  A graph,
consisting of nodes without edges, is drawn properly by the display
function.  This suggests that the problem may be associated specifically
with the line-output-record-element redisplay.  Moreover, if the
:INCREMENTAL-REDISPLAY pane option is NIL in the application definition,
so that incremental redislplay is disabled, the display function works
normally for all cases.

(NOTE: The display function code shows a second problem: additional
keyword arguments are not being passed to the Present presentation
method.  The global variables *ORIGIN* and *END* should really be
keyword arguments to the PRESENT-METHOD.)


DISPLAY FUNCTION

;;; The display function for the graph pane.
(defmethod display-graph ((graph-frame graph-frame) pane)
  (let ((node-origins (node-origins graph-frame)))
    (dolist (node-origin node-origins)
      (destructuring-bind (node origin) node-origin
	(updating-output (pane :unique-id node 
			       :cache-value (edges-from node) :cache-test #'eql
			       :all-new nil)
	  (dolist (edge (edges-from node))
	    (let ((end-point (second (assoc (to-node edge) node-origins))))
	      (pushnew (to-node edge) replay-nodes)
	      (setf *origin* origin *end* end-point)
	      (present edge 'edge :stream pane :view +edge-iconic-view+ :allow-other-keys t
		       :ORIGIN origin :END end-point )))
	  (setf *origin* origin)
	  (present node 'node :allow-other-keys t
		   :ORIGIN origin
		   :stream pane :view +node-iconic-view+)))))

;;; The Edge PRESENT presentation method.
(define-presentation-method present ((edge edges) (type edge) 
				     stream (view edge-iconic-view) &key origin end)
  (setf origin *origin* end *end*) ; hack
  (destructuring-bind (x0 y0) origin
    (destructuring-bind (x1 y1) end
      (draw-line* stream x0 y0 x1 y1))))


ERROR AND BACKTRACE

Command: (run-frame-top-level *graph-test*)
Error: No applicable method for #<STANDARD-GENERIC-FUNCTION REDISPLAY-1 24001632> with argument
s (#<CLIM::LINE-OUTPUT-RECORD-ELEMENT /x 223:224 y 184:185/ 132404055>
       #<CLIM::SHEET-WINDOW-STREAM /x 0:990 y 116:566/ 132405046> T)

REDISPLAY
   Arg 0 (CLIM::RECORD): #<CLIM::LINE-OUTPUT-RECORD-ELEMENT /x 223:224 y 184:185/ 132404055>
   Arg 1 (STREAM): #<CLIM::SHEET-WINDOW-STREAM /x 0:990 y 116:566/ 132405046>
   Rest arg: NIL

 Control-B Show Backtrace
REDISPLAY
  (:INTERNAL (:INTERNAL (:INTERNAL (:INTERNAL CLIM::REDISPLAY-FRAME-PANE-INTERNAL 0) 0) 0) 0)
  CLI::COMPATIBLE-RESTART-TRAMPOLINE
  (:INTERNAL (:INTERNAL (:INTERNAL CLIM::REDISPLAY-FRAME-PANE-INTERNAL 0) 0) 0)
  CLI::RESTART-BIND-TRAMPOLINE
  (:INTERNAL (:INTERNAL CLIM::REDISPLAY-FRAME-PANE-INTERNAL 0) 0)
  CLI::COMPATIBLE-RESTART-TRAMPOLINE  (:INTERNAL CLIM::REDISPLAY-FRAME-PANE-INTERNAL 0)
  CLI::RESTART-BIND-TRAMPOLINE  CLIM::REDISPLAY-FRAME-PANE-INTERNAL
  #<STANDARD-METHOD REDISPLAY-FRAME-PANES (APPLICATION-FRAME) 50152545>
  #<CLOS-INTERNALS::MISCELLANEOUS-FUNCTION STANDARD 542162017>  DEFAULT-FRAME-TOP-LEVEL
  #<STANDARD-METHOD RUN-FRAME-TOP-LEVEL (APPLICATION-FRAME) 50152355>  (:INTERNAL (:INTERNAL 
(:INTERNAL (:INTERNAL #<STANDARD-METHOD RUN-FRAME-TOP-LEVEL (:AROUND) (APPLICATION-FRAME) 50152
341> 0) 0) 0) 0)
  CLI::COMPATIBLE-RESTART-TRAMPOLINE  (:INTERNAL (:INTERNAL (:INTERNAL #<STANDARD-METHOD RUN-
FRAME-TOP-LEVEL (:AROUND) (APPLICATION-FRAME) 50152341> 0) 0) 0)
  CLI::RESTART-BIND-TRAMPOLINE  (:INTERNAL (:INTERNAL #<STANDARD-METHOD RUN-FRAME-TOP-LEVEL (
:AROUND) (APPLICATION-FRAME) 50152341> 0) 0)
  CLI::COMPATIBLE-RESTART-TRAMPOLINE
  (:INTERNAL #<STANDARD-METHOD RUN-FRAME-TOP-LEVEL (:AROUND) (APPLICATION-FRAME) 50152341> 0)
  CLI::RESTART-BIND-TRAMPOLINE
  #<STANDARD-METHOD RUN-FRAME-TOP-LEVEL (:AROUND) (APPLICATION-FRAME) 50152341>
  ZWEI:EVAL-PRINT  (:INTERNAL COMPILER:COMPILE-TO-CORE 0 :PROCESS-FORM)
  COMPILER:COMPILE-TO-CORE  COMPILER:COMPILE-TO-CORE  COMPILER:PROCESS-FORMS-FROM-STREAM
  ZWEI:COMPILE-INTERVAL  ZWEI:COMPILE-PRINT-INTERVAL
  (:INTERNAL ZWEI:COMPILE-DEFINITION-INTERNAL 0 ZWEI:.DEFINITION-REGION-CONTINUATION.)
  ZWEI:COMPILE-DEFINITION-INTERNAL  ZWEI:COM-EVALUATE-REGION
  PROCESS::WITH-DELAYED-PROCESS-PRIORITIES-INTERNAL  ZWEI:COMMAND-EXECUTE
  ZWEI:PROCESS-COMMAND-CHAR  (FLAVOR:METHOD :EDIT ZWEI:EDITOR)
  (:INTERNAL (FLAVOR:COMBINED :EDIT ZWEI:ZMACS-TOP-LEVEL-EDITOR) 1)
  PROCESS::WITH-PROCESS-PRIORITY-INTERNAL  (FLAVOR:NCWHOPPER :EDIT ZWEI:EDITOR)
  (FLAVOR:COMBINED :EDIT ZWEI:ZMACS-TOP-LEVEL-EDITOR)  ZWEI:ZMACS-WINDOW-TOP-LEVEL
  (FLAVOR:METHOD PROCESS::PROCESS-TOP-LEVEL-1 PROCESS:PROCESS)  PROCESS::PROCESS-TOP-LEVEL

0,,


Main Index | Thread Index