CLIM mail archive

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

presentation coordinates, or FORMATTED-CELL coordinates



   Date: Mon, 21 Sep 92 11:02:22 EDT
   From: Jeff Close <jclose@chesapeake.ads.com>
   Reply-To: jclose@ads.com

   OK, I thought I was clear before, but I'll try to be more specific.
   (BTW, this is Allegro, Clim 1.1, Sparc 1).  

   I know how Formatting-Table and -Graph work.  I  know that what I draw
   gets placed in normalized coordinates within the body of the overall
   formatting call.  Scott, you remark, "What this means is that, it
   doesn't matter what coordinate system you cell output in, because CLIM
   will always move it to the same place in the table.  So if you just
   pick a normalized coordinate system...".  But my problem is I WANT to
   know the absolute coordinates where these things are eventually
   placed.

The only real way to do this is to examine the state of the output
record tree after the fact (that is, after the formatting has been
completed).  So, you can either walk the tree yourself, looking for
"leaf" output records, or you can remember the presentations
associated with the cells you care about and inquire about their
positions.

This example remembers the last cell formatted.

(formatting-table (win)
  (dotimes (i 10)
    (formatting-row (win)
      (dotimes (j 10)
	(formatting-cell (win)
	  (setq foo (present (* i j) 'integer :stream win)))))))


You can then use:

(convert-from-descendant-to-ancestor-coordinates 
  foo
  (output-recording-stream-output-record win))

to get the position of the output record in the window.


(Now that I think of it, I'm not sure that
convert-from-descendant-to-ancestor-coordinates is documented (though
it seems exported in the CLIM I'm using).  If not, please re-read the
usual "unsupported function, you may lose in a future release" blurb
from some previous message.)


0,,

References:

Main Index | Thread Index