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

Pattern clarification



(setf xxx (make-instance 'window :color-p T))

(with-focused-view xxx
  (with-fore-color (make-color 0 40000 40000)
    (pen-normal xxx)
    (rlet ((old-pen :PenState))
      (pen-state xxx old-pen)
      (set-pen-pattern xxx *gray-pattern*)
      (set-pen-size  xxx (make-point 5 5))
      (move-to xxx 0 30)
      (line-to xxx 200 30)
      (set-pen-pattern xxx (rref old-pen :PenState.PnPat))
      (move-to xxx 0 50)
      (line-to xxx 200 50))))

It's back...

This code works.=, but it probably shouldn't  Apparently pen-pattern will
only return a 64-bit black and white pattern, so if you call it on a color
window, it won't return the appropriate PixPat.  However, contrary to the
docs, set-pen-pattern will take a PixPat and do the right thing, so I used
it here.  

Are pen-pattern and set-pen-pattern supposed to work for color windows, or
is it necessary to go through getting and setting the pen-state to mess
with the pen patterns for color windows?

Thanks in advance.