CLIM mail archive

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

clipping-regions




#+ACL-4.2
#+CLIM-2.0

I'm trying to control some of my output with clipping regions. but it
isn't working as expected. I did figure out that a bounding-rectangle
is a valid clipping-region (although the book can be read to imply
it's not).

I want to clip some text (and thus the presentation) into a rectangle.
sounds simple, no?

where I use

(with-drawing-options (stream :clipping-region <the rectangle>
				:align-x :right)
  (present "lotsoftexthere" 'string stream)
  )

...approximately.

what I want:

+--------+
|texthere|
+--------+

what I get:

+---------------+
|	texthere|
+---------------+

the rectangle "drawn" above is actually the sensitive area you see
with highlighting. the clipping region just surrounds the string
"texthere". but the presentation is not affected by the clipping
region.

have I done something wrong or is there an actual error here? it's not
like I need to do something fancy, I want ti clip drawing inside a
rectangular area and have the presentation be the size/location of the
clipping area.

or should I just modify the presentation myself afterwards somehow?

----

later: I figured out how to modify the presentation in a way that is
undoubtedly NOT safe, but does work.

    (setq <cell> (present "lotsoftexthere" 'string))
    ;;some stuff which corrects for clipping-region errors...
    ;;this form corrects for the presentation's width...
    (setf (slot-value (slot-value (slot-value <cell> 'clim-internals::elements)
				  'clim-internals::elements)
		      'clim-utils::right) width)
    ;;and this one corrects for it's left-edge.
    (setf (slot-value <cell> 'clim-internals::start-x) <some-x>)

real question: what is the correct way to get what I want here?

 -- clint



Main Index | Thread Index