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

Re: draw outside of window



I draw outside the window in my menu-enhancements.sit.hqx file
in the file marking-menus.lisp.  The trick is to use a variant
of the following technique:
  (with-focused-view the-view
    (rlet ((new-clip-region :region ... region parms  )
       (with-clip-rgn new-clip-region
          ... code to draw inside the new clip rect ....
       )))
The with-clip-rect macro is in the oodles-of-utils package:

  (defmacro with-clip-rgn (clip-rgn &body body)
    (let ((old-clip (gensym)))
      `(with-macptrs ((,old-clip (require-trap #_NewRgn)))
         (unwind-protect
           (progn
             (require-trap #_GetClip :ptr ,old-clip)
             (require-trap #_SetClip :ptr ,clip-rgn)
             ,@body)
           (require-trap #_SetClip :ptr ,old-clip)
           (require-trap #_DisposeRgn :ptr ,old-clip)))))