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

Re: window-drag-rect



     Since posting the last message, Brian Williams informed me that
window-drag-rect is a shared slot for the window class.  This accounts
for the behavior I described.  I think this indicates a flaw in the
documentation since the natural assumption is that slots are local
unless otherwise specified.  I reread the description of window-drag-
rect just to make sure that I hadn't misunderstood.  It implies that
there is one such rectangle per window, at least to me.  Anyway, Brian
was also kind enough to mail me a fix for the code I posted earlier.
For anyone interested, it is:

(defclass my-window (window)
  ((window-drag-rect :allocation :instance)))

(defmethod initialize-instance ((self my-window) &rest initargs)
  (declare (ignore initargs))
  (call-next-method)
  (let ((drag-rect (make-record :rect :topleft #@(0 0)
				      :bottomright #@(500 200))))
    (setf (slot-value self 'window-drag-rect) drag-rect)))

(defmethod window-close :after ((window my-window))
  (dispose-record (slot-value window 'window-drag-rect)))

That should do the trick.  Thanks Brian.  Are there any more
shared slots lurking out there waiting to trip me up?

As long as I'm using up bandwidth, I might as well point out
another window anomaly that I am sure is not a feature.  This only
works on inspector windows, as far as I can tell.  If you drag a
window down so that the resize box is half on and half off of the
screen, then push the scroll button to make the window scroll up a
line at a time, some interesting, almost desktop-colored lines
show up in between each line of text.  Interesting, n'est-ce pas?

Jerry James
jamesj@bert.cs.byu.edu