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

Revert menu-item not enable



REGARDING                Revert menu-item not enabled
#|
If we define a window-revert method for a window class, the
standard menu item "Revert" will not be enabled (when an instances
is made active) if we've also defined a window-needs-saving-p 
method for that class.

This behaviour can be replicated by evaluating the code below.
Test machines: FX, 16-32 meg sys 7.1. (more info when necessary)
Is this a bug?

Thanks in advance,

Andre Koehorst
Research Institute for Knowledge Systems
Maastricht, the Netherlands

|#
(defclass testwin (window)
  (
   (save-p :initarg :save-p :initform t :accessor save-p :documentation 
   "")
  )
  (:documentation
"")
  )

(defclass test2win (window)
  (
   (save-p :initarg :save-p :initform t :accessor save-p :documentation 
   "")
  )
  (:documentation
"")
  )

(defmethod window-revert ((win testwin) &optional dont-prompt)
  (format T "~%Should revert now"))

(defmethod window-revert ((win test2win) &optional dont-prompt)
  (format T "~%Should revert now"))

(defmethod window-save ((win testwin))
  (format T "~%Should save now"))

(defmethod window-save ((win test2win))
  (format T "~%Should save now"))

(defmethod window-needs-saving-p ((win testwin))
  (save-p win))

(make-instance 'testwin
  :window-title "Test1: without Revert")
(make-instance 'test2win
  :window-title "Test2: with Revert")