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

Bug with modal dialogs and windoids



Hello,


    I believe I have found a bug when you have nested modal dialogs and a
windoid present. I created a modal dialog which can invoke another modal
dialog when you press a certain button. AFter closing this second modal
dialog, the first modal dialog is left in an inconsistent state. This modal
dialog will process mouse clicks but it doesn't know that it is the active
window. Trying to bring up the second modal dialog for a second time will
cause the system to crash.


   Following is some sample code which produces this problem is ALLegro
1.3.2. If you call (make-main-modal-dialog) all works well. If you call
(make-main-modal-dialog t) then the anamoulous behavior will result.

ANy help you could provide would be appreciated!!!


The code follows:

;;; MODAL DIALOG BUG --- DEH 7/6/90
;;; When there is a windoid, bringing up the son-of-modal-dialog dialog and
then closing it, leaves the
;;; main modal dialog in a "funny" state. It will interpret mouse clicks but
it doesn't really know it
;;; is the active window. Trying to bring up the son-of-modal-dialog a second
time crashes the system!!

(defun make-main-modal-dialog (&optional with-windoid)
(and with-windoid (oneof *windoid*))
  (modal-dialog
      (oneof *dialog*
             :window-size #@(160 160)
             :window-show nil
             :window-type :document
             :window-title "Modal Dialog"
             :dialog-items
             (list 
              (oneof *button-dialog-item*
                     :dialog-item-position #@(5 5)
                     :dialog-item-size  #@(125 16) 
                     :dialog-item-text "Show me another"
                     :dialog-item-action (nfunction dialog-item-action
                                                    (lambda ()

(usual-dialog-item-action)

(son-of-modal-dialog))))
              (oneof *check-box-dialog-item*
                     :dialog-item-position #@(5 65)
                     :dialog-item-size  #@(150 16)
                     :dialog-item-text "Are you happy?")))))


(defun son-of-modal-dialog ()
  (modal-dialog
      (oneof *dialog*
             :window-size #@(150 100)
             :window-show nil
             :window-type :document
             :window-title "Son Dialog"
             :dialog-items
             (list 
              (oneof *editable-text-dialog-item*
                     :dialog-item-position #@(5 5)
                     :dialog-item-size  #@(125 16) 
                     :dialog-item-text "Show me another")
              (oneof *check-box-dialog-item*
                     :dialog-item-position #@(5 65)
                     :dialog-item-size  #@(150 16)
                     :dialog-item-text "Are you happy?")))))



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Thanks for any help,

   David Hirsch (hirsch@pw.com)