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

MACL view bug?

Here's the demo code from scrolling-windows.Lisp, modified to show how
add-self-to-dilog gets called a second time when the dialog is *closed*!

I think this is buggy behavior and I've had to patch my application's
code to check for my-dialog being nil, a symptom of the 2nd call.


<demo code follows>

(require :scrolling-windows "ccl;examples:scrolling-windows")
(require 'quickdraw)

(setq foo (oneof *scrolling-window*
                 :window-type :document-with-zoom))

(defobfun (view-draw-contents (ask foo my-scroller)) ()
  ;; draw the snazzy background
  (paint-oval 75 75 200 200)
  (frame-rect 20 20 100 100)
  (erase-oval 50 50 135 135)
  ;; let this view's dialog items draw too/mc

(ask foo (view-draw-contents))	;since we just defined it! mc

;;; MACL Bug:
;;; If you use foo (commented out below), (add-self-to-dialog temp) is run once.
;;; If you use (ask foo my-scroller), as shown below, it's run *twice*. <- bug!
(ask (ask foo my-scroller)	;foo
  (let ((temp (oneof *button-dialog-item*
                     :dialog-item-font '("Chicago" 12)
                     :dialog-item-action '(ed-beep)
                     :default-button t
                     :dialog-item-position #@(120 20)
                     :dialog-item-text "Beep")))
    (defobfun (add-self-to-dialog temp) (view)
      (print "-> AddingI")
      (usual-add-self-to-dialog view))
    (add-dialog-items temp)))