ProcessMonitor.st
changeset 58 43b7d463a7e5
parent 57 36e13831b62d
child 85 d9713a3ca092
--- a/ProcessMonitor.st	Mon Feb 06 02:01:18 1995 +0100
+++ b/ProcessMonitor.st	Wed Feb 08 04:21:08 1995 +0100
@@ -37,7 +37,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libtool/ProcessMonitor.st,v 1.6 1995-02-06 01:00:14 claus Exp $
+$Header: /cvs/stx/stx/libtool/ProcessMonitor.st,v 1.7 1995-02-08 03:21:02 claus Exp $
 "
 !
 
@@ -110,6 +110,7 @@
 			 '-'  
 			 'resume'  
 			 'suspend'  
+			 'abort'
 			 'terminate'
 			 '-'  
 			 'raise prio'  
@@ -123,6 +124,7 @@
 			 nil  
 			 resumeProcess  
 			 suspendProcess  
+			 abortProcess
 			 terminateProcess
 			 nil  
 			 raisePrio
@@ -252,6 +254,12 @@
     ].
 "/    self updateStatus.
 "/    self updateList.
+!
+
+selectedProcessesSend:aSelector
+    self selectedProcessesDo:[:p |
+	p perform:aSelector
+    ]
 ! !
 
 !ProcessMonitor methodsFor:'menu actions'!
@@ -267,27 +275,25 @@
 ! 
 
 inspectProcess
+    self selectedProcessesSend:#inspect
+! 
+
+abortProcess
     self selectedProcessesDo:[:p |
-       p inspect
+	p interruptWith:[AbortSignal raise]
     ]
 ! 
 
 terminateProcess
-    self selectedProcessesDo:[:p |
-       p terminate
-    ]
+    self selectedProcessesSend:#terminate
 ! 
 
 resumeProcess
-    self selectedProcessesDo:[:p |
-       p resume
-    ]
+    self selectedProcessesSend:#resume
 ! 
 
 suspendProcess
-    self selectedProcessesDo:[:p |
-       p suspend
-    ]
+    self selectedProcessesSend:#suspend
 ! 
 
 raisePrio
@@ -430,21 +436,19 @@
 		processes at:index put:nil
 	    ]
 	].
-	list ~= oldList ifTrue:[
-	    "avoid flicker"
-	    (oldList notNil and:[oldList size == list size]) ifTrue:[
-		list keysAndValuesDo:[:idx :entry |
-		    (oldList at:idx) ~= entry ifTrue:[
-			listView at:idx put:entry
-		    ]
+	"avoid flicker"
+	(oldList notNil and:[oldList size == list size]) ifTrue:[
+	    list keysAndValuesDo:[:idx :entry |
+		(oldList at:idx) ~= entry ifTrue:[
+		    listView at:idx put:entry
 		]
-	    ] ifFalse:[
-		listView setList:list.
-		"the first two entries cannot be selected"
-		listView attributeAt:1 put:#disabled.
-		listView attributeAt:2 put:#disabled.
 	    ]
-	].
+	] ifFalse:[
+	    listView setList:list.
+	    "the first two entries cannot be selected"
+	    listView attributeAt:1 put:#disabled.
+	    listView attributeAt:2 put:#disabled.
+	]
     ].
     updateBlock notNil ifTrue:[
 	Processor addTimedBlock:updateBlock afterSeconds:updateDelay