(FILECREATED "21-Mar-87 17:15:18" {ERIS}<LISPUSERS>KOTO>WDWHACKS.;1 5073   

      changes to:  (FNS SMASH.THE.DAMNED.CONST.IN.ATTACHWINDOW)

      previous date: "19-Mar-86 23:25:10" {PHYLUM}<LISP>KOTO>LISPUSERS>WDWHACKS.;1)


(PRETTYCOMPRINT WDWHACKSCOMS)

(RPAQQ WDWHACKSCOMS ((FNS CLOSE.WINDOWS.IN.REGION SHAPEW.AND.SAVE SHAPEW.POP 
			    SMASH.THE.DAMNED.CONST.IN.ATTACHWINDOW Inspecticide)
		       (DECLARE: DONTEVAL@LOAD DOCOPY
				 (P (RPLACA (CDR (ASSOC (QUOTE Shape)
							WindowMenuCommands))
					    (QUOTE (QUOTE SHAPEW.AND.SAVE)))
				    (RPLACD (CDDR (ASSOC (QUOTE Shape)
							 WindowMenuCommands))
					    (COPY (QUOTE ((SUBITEMS ("PopShape" (QUOTE SHAPEW.POP)
										
						 "Return a reshaped window to its original form.")))))
					    )
				    (SETQ WindowMenu NIL)
				    (SETQ BackgroundMenuCommands
					  (CONS (COPY (QUOTE ("SlamWs" (QUOTE (CLOSE.WINDOWS.IN.REGION
										))
								       
					       "Close all the windows in a region of the screen."
								       (SUBITEMS
									 ("Inspectors"
									   (QUOTE (Inspecticide))
									   
								  "Close only inspector windows.")))))
						BackgroundMenuCommands))
				    (SETQ BackgroundMenu NIL)
				    (SMASH.THE.DAMNED.CONST.IN.ATTACHWINDOW)))))
(DEFINEQ

(CLOSE.WINDOWS.IN.REGION
  [LAMBDA (R)                                                (* edited: "12-May-85 22:27")
    (OR R (SETQ R (GETREGION)))
    (for W in (OPENWINDOWS) do (COND
				 ((INTERSECTREGIONS R (WINDOWPROP W (QUOTE REGION)))
				   (CLOSEW W])

(SHAPEW.AND.SAVE
  [LAMBDA (WINDOW NEWREGION)                                  (* Jeff.Shrager 
                                                                  "18-Mar-86 18:01")
    (WINDOWPROP WINDOW (QUOTE OLD.SHAPE)
           (WINDOWREGION WINDOW))
    (SHAPEW WINDOW NEWREGION])

(SHAPEW.POP
  [LAMBDA (WINDOW)                                            (* Jeff.Shrager 
                                                                  "18-Mar-86 18:01")
    (COND
       ((WINDOWPROP WINDOW (QUOTE OLD.SHAPE))
        (SHAPEW WINDOW (WINDOWPROP WINDOW (QUOTE OLD.SHAPE)
                              (WINDOWREGION WINDOW])

(SMASH.THE.DAMNED.CONST.IN.ATTACHWINDOW
  (LAMBDA NIL                                                (* rht: "19-Mar-87 15:28")

          (* * This is the universe's worst known hack. Whoever wrote ATTACHEDWINDOW put hard constants into the ATTACHWINDOW
	  fn which get inserted into the PASSTOMAINCOMS prop of attached windows. This should be a var so that we can tell it
	  what messages to pass or not in a general case. This function creates an attached window and 
	  (you'll love this) smashes the prop's value so that the const in the ATTACHWINDOW function is smashed so that 
	  everything works pretty generally. Yuko!!!)


    (LET ((TEMPWINDOW (CREATEW (QUOTE (0 0 10 10))))
	  MAINWINDOW)
         (ATTACHWINDOW TEMPWINDOW (SETQ MAINWINDOW (CREATEW (QUOTE (0 0 10 10))))
			 (QUOTE TOP))
         (RPLACD (WINDOWPROP TEMPWINDOW (QUOTE PASSTOMAINCOMS))
		   (APPEND (COPY (QUOTE (SHAPEW.POP SHAPEW.AND.SAVE)))
			     (CDR (WINDOWPROP TEMPWINDOW (QUOTE PASSTOMAINCOMS)))))
         (CLOSEW TEMPWINDOW)
         (CLOSEW MAINWINDOW))
    (LET ((TEMPWINDOW (CREATEW (QUOTE (0 0 10 10))))
	  MAINWINDOW)
         (ATTACHWINDOW TEMPWINDOW (SETQ MAINWINDOW (CREATEW (QUOTE (0 0 10 10))))
			 (QUOTE TOP)
			 NIL
			 (QUOTE LOCALCLOSE))
         (RPLACD (WINDOWPROP TEMPWINDOW (QUOTE PASSTOMAINCOMS))
		   (APPEND (COPY (QUOTE (SHAPEW.POP SHAPEW.AND.SAVE)))
			     (CDR (WINDOWPROP TEMPWINDOW (QUOTE PASSTOMAINCOMS)))))
         (CLOSEW TEMPWINDOW)
         (CLOSEW MAINWINDOW))))

(Inspecticide
  [LAMBDA NIL                                                (* edited: "13-Sep-85 18:35")
    (for w in (OPENWINDOWS) when [AND (EQ (QUOTE INSPECTW.REPAINTFN)
					  (WINDOWPROP w (QUOTE REPAINTFN)))
				      (STRPOS "Inspector" (WINDOWPROP w (QUOTE TITLE]
       do (CLOSEW w])
)
(DECLARE: DONTEVAL@LOAD DOCOPY 
(RPLACA (CDR (ASSOC (QUOTE Shape)
		    WindowMenuCommands))
	(QUOTE (QUOTE SHAPEW.AND.SAVE)))
(RPLACD (CDDR (ASSOC (QUOTE Shape)
		     WindowMenuCommands))
	(COPY (QUOTE ((SUBITEMS ("PopShape" (QUOTE SHAPEW.POP)
					    "Return a reshaped window to its original form."))))))
(SETQ WindowMenu NIL)
(SETQ BackgroundMenuCommands (CONS (COPY (QUOTE ("SlamWs" (QUOTE (CLOSE.WINDOWS.IN.REGION))
							  
					       "Close all the windows in a region of the screen."
							  (SUBITEMS ("Inspectors" (QUOTE (Inspecticide
											   ))
										  
								  "Close only inspector windows.")))))
				   BackgroundMenuCommands))
(SETQ BackgroundMenu NIL)
(SMASH.THE.DAMNED.CONST.IN.ATTACHWINDOW)
)
(PUTPROPS WDWHACKS COPYRIGHT (NONE))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1267 4285 (CLOSE.WINDOWS.IN.REGION 1277 . 1593) (SHAPEW.AND.SAVE 1595 . 1893) (
SHAPEW.POP 1895 . 2251) (SMASH.THE.DAMNED.CONST.IN.ATTACHWINDOW 2253 . 3923) (Inspecticide 3925 . 4283
)))))
STOP