home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / lisp / mcl / 1934 < prev    next >
Encoding:
Text File  |  1993-01-05  |  2.3 KB  |  71 lines

  1. Newsgroups: comp.lang.lisp.mcl
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!aplcen.apl.jhu.edu!aplpy.jhuapl.edu!gersh
  3. From: gersh@aplpy.jhuapl.edu (John R. Gersh)
  4. Subject: Re: remove-view-from-window
  5. Message-ID: <1993Jan5.212802.18504@aplcen.apl.jhu.edu>
  6. Summary: Works all right for me.
  7. Sender: news@aplcen.apl.jhu.edu (USENET News System)
  8. Organization: Johns Hopkins University Applied Physics Lab
  9. References: <9301051918.AA19536@newton.apple.com>
  10. Date: Tue, 5 Jan 93 21:28:02 GMT
  11. Lines: 58
  12.  
  13. In article <9301051918.AA19536@newton.apple.com> Maurice Sharp writes:
  14. >
  15. >According to both the manual and MCL.help the arguments to
  16. >remove-view-from-window are a view and a window.
  17. >
  18. >This is not correct, there are actually no arguments.
  19. >
  20.  
  21. Well, actually there seem to be three versions:
  22.     
  23.     The manual says that the argument to remove-view-from-window
  24.     is a view.
  25.  
  26.     The built-in documentation (c-x c-d) says that the arguments
  27.     are a view and a window.
  28.  
  29.     If you inspect the function the inspector window says that its
  30.     arglist is nil.
  31.  
  32. The manual appears to be correct - the function works as one would
  33. expect from its description if you give it a view as an argument.
  34.  
  35. >My question... is there some alternate method that I can use instead of
  36. >remove-view-from-window to perform actions prior to a views removal from a
  37. >window or subview?
  38.  
  39. Well, remove-view-from-window seems to work OK at doing that. Here's
  40. some test code to demonstrate that:
  41.  
  42. (defclass special-view (view) ())
  43.  
  44. (defmethod view-draw-contents ((s-v special-view))
  45.   (frame-oval s-v #@(0 0) #@(100 100)))  ;so we can see when the view
  46.                          ;is installed
  47.  
  48. (defmethod install-view-in-window ((s-v special-view) window)
  49.   (set-back-color window *blue-color*)
  50.   (call-next-method s-v window))
  51.  
  52. (defmethod remove-view-from-window ((s-v special-view))
  53.   (set-back-color (view-container s-v) *red-color*)
  54.   (call-next-method s-v))
  55.  
  56. (setf the-view (make-instance 'special-view))
  57.  
  58. (setf the-window (make-instance 'window :color-p t))
  59.  
  60. ;;Then try the following in succession:
  61.  
  62. (add-subviews the-window the-view)
  63.  
  64. (remove-subviews the-window the-view)
  65.  
  66.  
  67. ---------------------------------------------------------------------
  68. John Gersh                                      John_Gersh@jhuapl.edu
  69. The Johns Hopkins University Applied Physics Laboratory
  70. Johns Hopkins Rd., Laurel, MD 20723               (301) 953-5503
  71.