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

problems with views and dialog items

I am seeing some wierd things happening with dialog items in views!  Below
is some example code that demonstrates the problem.  I would like to create
a view with some dialog items in it and contain the view in a window.  But
when I add the view to the dialog window, the buttons in the view seem to
be contained in both the dialog and the view.  Clicking in the position
where the button would be installed on the dialog window (i.e., #@(20 20)
in the dialog WINDOW coordinates) makes the button show up and executes the
buttons action.  I believe that it has to do with local-to-global but I
can't track it down.  Any ideas?

(defobject *test-dialog-view* *dialog-view*)

(defobfun (view-draw-contents *test-dialog-view*) ()
  (frame-rect 0 (view-size))

(setq x (oneof *dialog*
               :window-size #@(200 200)
               :window-type :document-with-zoom))

(setq y (oneof *test-dialog-view* :view-size #@(80 80)))

(setq d1 (oneof *button-dialog-item* :dialog-item-text "test1"
                :dialog-item-position #@(20 20)))

(ask y (add-dialog-items d1))

(ask y (set-view-position #@(110 110)))

(ask y (set-view-container x))

;;; Now click in the *dialog* window in the position where the button would
;;; be installed if added directly to the *dialog* window (i.e., at
;;; #@(20 20) of the *dialog* window).  The button shows up and its action
;;; is executed.----------------------------------------------------------------------
|  Daniel N Hennessy           |                                     |
|  Lockheed AI Center          |  Office: (415) 354-5207             |
|  Orgn. 96-20, Bldg. 254F     |  Fax:    (415) 354-5235             |
|  3251 Hanover St.            |  E-mail: hennessy@laic.lockheed.com |
|  Palo Alto, CA  94304-1191   |                                     |