52
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
143
|
13 |
'From Smalltalk/X, Version:2.10.7 on 29-sep-1995 at 02:24:01' !
|
85
|
14 |
|
93
|
15 |
SimpleView subclass:#ProcessMonitor
|
85
|
16 |
instanceVariableNames:'listView processes listUpdateDelay updateDelay updateBlock
|
143
|
17 |
listUpdateBlock updateProcess hideDead runColor suspendedColor
|
|
18 |
waitColor cpuUsages showDetail'
|
45
|
19 |
classVariableNames:''
|
|
20 |
poolDictionaries:''
|
|
21 |
category:'Interface-Tools'
|
19
|
22 |
!
|
|
23 |
|
52
|
24 |
!ProcessMonitor class methodsFor:'documentation'!
|
|
25 |
|
|
26 |
copyright
|
|
27 |
"
|
|
28 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
|
29 |
All Rights Reserved
|
|
30 |
|
|
31 |
This software is furnished under a license and may be used
|
|
32 |
only in accordance with the terms of that license and with the
|
|
33 |
inclusion of the above copyright notice. This software may not
|
|
34 |
be provided or otherwise made available to, or used by, any
|
|
35 |
other person. No title to or ownership of the software is
|
|
36 |
hereby transferred.
|
|
37 |
"
|
|
38 |
!
|
|
39 |
|
|
40 |
version
|
|
41 |
"
|
143
|
42 |
$Header: /cvs/stx/stx/libtool/Attic/ProcMonitor.st,v 1.22 1995-09-28 20:27:16 cg Exp $
|
52
|
43 |
"
|
|
44 |
!
|
|
45 |
|
|
46 |
documentation
|
|
47 |
"
|
|
48 |
This view shows smalltalks (light-weight) processes, and also offers
|
|
49 |
a popup menu for various useful operations on them.
|
|
50 |
Especially 'debug' is useful, to see what a process is currently
|
|
51 |
doing.
|
85
|
52 |
|
52
|
53 |
The information shown is:
|
90
|
54 |
id - the numeric id of the process
|
|
55 |
name - the name (if any) of the process
|
|
56 |
(the name has no semantic meaning; it exists for the processMonitor only)
|
|
57 |
state - what is it doing;
|
|
58 |
wait - waiting on a semaphore
|
|
59 |
eventWait - waiting on a view-event semaphore
|
|
60 |
ioWait - waiting on an io-semaphore
|
|
61 |
timeWait - waiting for a time-semaphore
|
|
62 |
run - run, but currently not scheduled
|
|
63 |
active - really running (this info is useless, since at
|
|
64 |
update time, its always the update process which is
|
|
65 |
running)
|
|
66 |
suspended - suspended; not waiting on a semaphore
|
|
67 |
light - not yet started (i.e. has no stack yet)
|
52
|
68 |
|
90
|
69 |
prio - the processes priority (1..30)
|
|
70 |
usedStack - the current stack use
|
|
71 |
totalStack - the stack currently allocated (i.e. the maximum ever needed)
|
52
|
72 |
"
|
|
73 |
! !
|
|
74 |
|
56
|
75 |
!ProcessMonitor class methodsFor:'defaults'!
|
19
|
76 |
|
56
|
77 |
defaultLabel
|
|
78 |
^ 'Process Monitor'
|
|
79 |
!
|
19
|
80 |
|
56
|
81 |
defaultIcon
|
|
82 |
|i|
|
19
|
83 |
|
93
|
84 |
i := Image fromFile:'ProcMon.xbm'.
|
56
|
85 |
i notNil ifTrue:[^ i].
|
85
|
86 |
^ StandardSystemView defaultIcon
|
|
87 |
! !
|
|
88 |
|
|
89 |
!ProcessMonitor class methodsFor:'startup'!
|
|
90 |
|
|
91 |
open
|
|
92 |
|top monitor|
|
|
93 |
|
|
94 |
top := StandardSystemView new.
|
|
95 |
monitor := self origin:0.0@0.0 corner:1.0@1.0 in:top.
|
105
|
96 |
top extent:monitor preferredExtent.
|
85
|
97 |
top label:self defaultLabel.
|
|
98 |
top icon:self defaultIcon.
|
|
99 |
top open
|
|
100 |
|
|
101 |
"
|
|
102 |
ProcessMonitor open
|
|
103 |
"
|
|
104 |
! !
|
|
105 |
|
143
|
106 |
!ProcessMonitor methodsFor:'destroying'!
|
|
107 |
|
|
108 |
destroy
|
|
109 |
updateBlock notNil ifTrue:[
|
|
110 |
Processor removeTimedBlock:updateBlock.
|
|
111 |
Processor removeTimedBlock:listUpdateBlock.
|
|
112 |
] ifFalse:[
|
|
113 |
updateProcess notNil ifTrue:[updateProcess terminate]
|
|
114 |
].
|
|
115 |
super destroy
|
|
116 |
! !
|
|
117 |
|
85
|
118 |
!ProcessMonitor methodsFor:'drawing'!
|
|
119 |
|
|
120 |
titleLine
|
109
|
121 |
showDetail ifTrue:[
|
143
|
122 |
^ 'id name state prio usedStack totalStack current-segment switches where'.
|
109
|
123 |
].
|
143
|
124 |
^ 'id name state prio usedStack where'.
|
85
|
125 |
!
|
|
126 |
|
|
127 |
updateList
|
|
128 |
"update list of processes"
|
|
129 |
|
|
130 |
|newList|
|
|
131 |
|
|
132 |
shown ifTrue:[
|
109
|
133 |
showDetail ifTrue:[
|
90
|
134 |
newList := Process allInstances.
|
|
135 |
] ifFalse:[
|
|
136 |
newList := ProcessorScheduler knownProcesses asOrderedCollection.
|
|
137 |
].
|
85
|
138 |
|
90
|
139 |
"sort by id - take care of nil ids of dead processes"
|
|
140 |
newList sort:[:p1 :p2 |
|
|
141 |
|id1 id2|
|
85
|
142 |
|
90
|
143 |
(p1 isNil or:[(id1 := p1 id) isNil])
|
|
144 |
ifTrue:[true]
|
|
145 |
ifFalse:[
|
|
146 |
(p2 isNil or:[(id2 := p2 id) isNil])
|
|
147 |
ifTrue:[false]
|
|
148 |
ifFalse:[id1 < id2]
|
|
149 |
]
|
|
150 |
].
|
|
151 |
newList ~= processes ifTrue:[
|
|
152 |
processes := WeakArray withAll:newList.
|
|
153 |
self updateStatus
|
|
154 |
].
|
85
|
155 |
].
|
|
156 |
updateBlock notNil ifTrue:[
|
90
|
157 |
Processor removeTimedBlock:listUpdateBlock.
|
|
158 |
Processor addTimedBlock:listUpdateBlock afterSeconds:listUpdateDelay
|
85
|
159 |
].
|
|
160 |
!
|
|
161 |
|
|
162 |
updateStatus
|
|
163 |
"update status display of processes"
|
|
164 |
|
110
|
165 |
|oldList list line dIndex con interrupted plist|
|
85
|
166 |
|
|
167 |
shown ifTrue:[
|
143
|
168 |
oldList := listView list.
|
|
169 |
processes notNil ifTrue:[
|
|
170 |
list := OrderedCollection new.
|
|
171 |
list add:self titleLine.
|
|
172 |
list add:(String new:self titleLine size withAll:$-).
|
85
|
173 |
|
143
|
174 |
interrupted := Processor interruptedProcess.
|
85
|
175 |
|
143
|
176 |
dIndex := 1.
|
|
177 |
1 to:processes size do:[:index |
|
|
178 |
|aProcess nm st c c0 n found|
|
85
|
179 |
|
143
|
180 |
aProcess := processes at:index.
|
|
181 |
aProcess notNil ifTrue:[
|
|
182 |
(aProcess id notNil or:[hideDead not]) ifTrue:[
|
|
183 |
line := aProcess id printStringPaddedTo:5.
|
|
184 |
(nm := aProcess name) isNil ifFalse:[
|
|
185 |
nm := nm printString
|
|
186 |
] ifTrue:[
|
|
187 |
nm := ' '
|
|
188 |
].
|
|
189 |
nm size >= 29 ifTrue:[
|
|
190 |
nm := (nm contractTo:28) , ' '
|
|
191 |
] ifFalse:[
|
|
192 |
nm := (nm printStringPaddedTo:29).
|
|
193 |
].
|
|
194 |
line := line , nm.
|
85
|
195 |
"/ n := cpuUsages at:(aProcess id) ifAbsent:[0].
|
|
196 |
"/ n ~~ 0 ifTrue:[
|
|
197 |
"/ line := line , ((n * 4) printStringLeftPaddedTo:3)
|
|
198 |
"/ ] ifFalse:[
|
|
199 |
"/ line := line , ' '
|
|
200 |
"/ ].
|
143
|
201 |
st := aProcess state.
|
|
202 |
(st == #run
|
|
203 |
and:[aProcess == interrupted]) ifTrue:[
|
|
204 |
c := ' *'.
|
|
205 |
] ifFalse:[
|
|
206 |
c := ' '.
|
|
207 |
].
|
|
208 |
line := line , c , (st printStringPaddedTo:9).
|
|
209 |
line := line , (aProcess priority printStringLeftPaddedTo:3).
|
|
210 |
line := line , (aProcess usedStackSize printStringLeftPaddedTo:11).
|
|
211 |
|
|
212 |
n := aProcess numberOfStackSegments.
|
|
213 |
n == 0 ifTrue:[
|
|
214 |
con := nil
|
|
215 |
] ifFalse:[
|
|
216 |
con := aProcess suspendedContext.
|
|
217 |
con isNil ifTrue:[
|
|
218 |
aProcess == Processor activeProcess ifTrue:[
|
|
219 |
con := thisContext
|
|
220 |
]
|
|
221 |
]
|
|
222 |
].
|
|
223 |
showDetail ifTrue:[
|
|
224 |
line := line , (aProcess totalStackSize printStringLeftPaddedTo:10).
|
|
225 |
line := line , '(' , n printString , ')'.
|
|
226 |
con notNil ifTrue:[
|
|
227 |
line := line , ' '.
|
|
228 |
line := line , ((ObjectMemory addressOf:con) printStringRadix:16).
|
|
229 |
line := line , ' .. '.
|
|
230 |
c := con.
|
|
231 |
[c sender notNil] whileTrue:[
|
|
232 |
c := c sender
|
|
233 |
].
|
|
234 |
line := line , ((ObjectMemory addressOf:c) printStringRadix:16).
|
|
235 |
] ifFalse:[
|
|
236 |
line := line , (String new:20)
|
|
237 |
].
|
|
238 |
line := line , ' '.
|
|
239 |
line := line , (aProcess numberOfStackBoundaryHits printStringLeftPaddedTo:5).
|
|
240 |
].
|
|
241 |
|
|
242 |
con notNil ifTrue:[
|
|
243 |
"/ search for a semaphore-wait in the top 10 contexts
|
|
244 |
found := false.
|
|
245 |
c := con.
|
|
246 |
1 to:10 do:[:n |
|
|
247 |
found ifFalse:[
|
|
248 |
c notNil ifTrue:[
|
|
249 |
(c receiver isMemberOf:Semaphore) ifTrue:[
|
|
250 |
c selector == #wait ifTrue:[
|
|
251 |
found := true.
|
|
252 |
]
|
|
253 |
].
|
|
254 |
c := c sender.
|
|
255 |
]
|
|
256 |
]
|
|
257 |
].
|
|
258 |
found ifFalse:[
|
|
259 |
c := con.
|
|
260 |
1 to:10 do:[:n |
|
|
261 |
found ifFalse:[
|
|
262 |
c notNil ifTrue:[
|
|
263 |
(c receiver ~~ Processor) ifTrue:[
|
|
264 |
found := true.
|
|
265 |
] ifFalse:[
|
|
266 |
c := c sender.
|
|
267 |
]
|
|
268 |
]
|
|
269 |
]
|
|
270 |
]
|
|
271 |
].
|
|
272 |
found ifFalse:[
|
|
273 |
c := con
|
|
274 |
].
|
|
275 |
[c isBlockContext] whileTrue:[
|
|
276 |
c := c home
|
|
277 |
].
|
|
278 |
n := c receiver class name , '>>' , c selector.
|
|
279 |
line := line , ' ' , n
|
|
280 |
].
|
|
281 |
list add:line.
|
|
282 |
processes at:dIndex put:aProcess.
|
|
283 |
dIndex := dIndex + 1
|
|
284 |
]
|
|
285 |
].
|
|
286 |
].
|
|
287 |
dIndex to:processes size do:[:index |
|
|
288 |
processes at:index put:nil
|
|
289 |
]
|
|
290 |
].
|
|
291 |
"avoid flicker"
|
|
292 |
(oldList notNil and:[oldList size == list size]) ifTrue:[
|
|
293 |
list keysAndValuesDo:[:idx :entry |
|
|
294 |
(oldList at:idx) ~= entry ifTrue:[
|
|
295 |
listView at:idx put:entry
|
|
296 |
]
|
|
297 |
]
|
|
298 |
] ifFalse:[
|
|
299 |
listView setList:list.
|
|
300 |
"the first two entries cannot be selected"
|
|
301 |
listView attributeAt:1 put:#disabled.
|
|
302 |
listView attributeAt:2 put:#disabled.
|
|
303 |
]
|
85
|
304 |
].
|
|
305 |
updateBlock notNil ifTrue:[
|
143
|
306 |
Processor removeTimedBlock:updateBlock.
|
|
307 |
Processor addTimedBlock:updateBlock afterSeconds:updateDelay
|
85
|
308 |
]
|
|
309 |
!
|
|
310 |
|
|
311 |
updateView
|
|
312 |
self updateList.
|
|
313 |
self updateStatus
|
19
|
314 |
! !
|
|
315 |
|
143
|
316 |
!ProcessMonitor methodsFor:'events'!
|
|
317 |
|
|
318 |
keyPress:key x:x y:y
|
|
319 |
<resource: #keyboard ( #InspectIt ) >
|
|
320 |
|
|
321 |
key == #InspectIt ifTrue:[
|
|
322 |
^ self inspectProcess.
|
|
323 |
].
|
|
324 |
^ super keyPress:key x:x y:y
|
|
325 |
!
|
|
326 |
|
|
327 |
canHandle:key
|
|
328 |
^ key == #InspectIt
|
|
329 |
! !
|
|
330 |
|
19
|
331 |
!ProcessMonitor methodsFor:'initialization'!
|
|
332 |
|
|
333 |
initialize
|
107
|
334 |
|v|
|
19
|
335 |
|
|
336 |
super initialize.
|
|
337 |
|
45
|
338 |
hideDead := true.
|
109
|
339 |
showDetail := Smalltalk at:#SystemDebugging ifAbsent:false.
|
45
|
340 |
|
110
|
341 |
v := HVScrollableView for:SelectionInListView miniScrollerH:true in:self.
|
19
|
342 |
v origin:0.0@0.0 corner:1.0@1.0.
|
85
|
343 |
|
|
344 |
"/ self extent:(font widthOf:self titleLine) + v scrollBar width @ 100.
|
|
345 |
|
19
|
346 |
listView := v scrolledView.
|
|
347 |
listView font:font.
|
98
|
348 |
listView menuHolder:self; menuPerformer:self; menuMessage:#processMenu.
|
45
|
349 |
|
19
|
350 |
listView multipleSelectOk:true.
|
97
|
351 |
listView delegate:(KeyboardForwarder toView:self).
|
19
|
352 |
|
|
353 |
updateDelay := 0.5.
|
|
354 |
listUpdateDelay := 5.
|
45
|
355 |
|
|
356 |
"/ true
|
|
357 |
ProcessorScheduler isPureEventDriven
|
|
358 |
ifTrue:[
|
90
|
359 |
updateBlock := [self updateStatus].
|
|
360 |
listUpdateBlock := [self updateList].
|
19
|
361 |
].
|
45
|
362 |
|
19
|
363 |
device hasColors ifTrue:[
|
90
|
364 |
runColor := Color green.
|
|
365 |
suspendedColor := Color yellow.
|
|
366 |
waitColor := Color red.
|
19
|
367 |
] ifFalse:[
|
90
|
368 |
runColor := suspendedColor := waitColor := Color black
|
19
|
369 |
]
|
|
370 |
|
45
|
371 |
"
|
|
372 |
ProcessMonitor open
|
|
373 |
"
|
19
|
374 |
!
|
|
375 |
|
85
|
376 |
mapped
|
|
377 |
super mapped.
|
|
378 |
self updateStatus.
|
|
379 |
self updateList.
|
|
380 |
!
|
|
381 |
|
93
|
382 |
startUpdateProcess
|
19
|
383 |
updateBlock notNil ifTrue:[
|
90
|
384 |
Processor addTimedBlock:updateBlock afterSeconds:updateDelay.
|
|
385 |
Processor addTimedBlock:listUpdateBlock afterSeconds:listUpdateDelay.
|
19
|
386 |
] ifFalse:[
|
90
|
387 |
updateProcess := [
|
|
388 |
Process terminateSignal handle:[:ex |
|
|
389 |
updateProcess := nil
|
|
390 |
] do:[
|
|
391 |
|id cnt|
|
56
|
392 |
|
90
|
393 |
"
|
|
394 |
every 20ms, we look which process runs;
|
|
395 |
every half second, the status is updated.
|
|
396 |
every 5 seconds, the list of processes is
|
|
397 |
built up again
|
|
398 |
"
|
|
399 |
[true] whileTrue:[
|
|
400 |
1 to:9 do:[:i |
|
85
|
401 |
"/ cpuUsages := IdentityDictionary new.
|
|
402 |
"/ 1 to:25 do:[:i |
|
|
403 |
"/ (Delay forSeconds:0.02) wait.
|
|
404 |
"/ id := Processor interruptedProcess id.
|
|
405 |
"/ cnt := cpuUsages at:id ifAbsent:[0].
|
|
406 |
"/ cpuUsages at:id put:cnt + 1.
|
|
407 |
"/ ].
|
90
|
408 |
(Delay forSeconds:0.5) wait.
|
|
409 |
self updateStatus.
|
|
410 |
].
|
|
411 |
(Delay forSeconds:0.5) wait.
|
|
412 |
self updateList.
|
|
413 |
]
|
|
414 |
]
|
|
415 |
] forkAt:(Processor userSchedulingPriority + 1).
|
|
416 |
updateProcess name:'monitor [' ,
|
|
417 |
Processor activeProcess id printString ,
|
|
418 |
'] update'.
|
|
419 |
"
|
|
420 |
raise my own priority
|
|
421 |
"
|
|
422 |
Processor activeProcess priority:(Processor userSchedulingPriority + 2)
|
19
|
423 |
].
|
93
|
424 |
!
|
|
425 |
|
|
426 |
realize
|
|
427 |
super realize.
|
45
|
428 |
waitColor := waitColor on:device.
|
|
429 |
runColor := runColor on:device.
|
19
|
430 |
suspendedColor := suspendedColor on:device.
|
93
|
431 |
|
|
432 |
self startUpdateProcess.
|
19
|
433 |
! !
|
|
434 |
|
|
435 |
!ProcessMonitor methodsFor:'menu actions'!
|
|
436 |
|
85
|
437 |
processMenu
|
|
438 |
|labels selectors m|
|
|
439 |
|
109
|
440 |
device ctrlDown ifTrue:[
|
110
|
441 |
labels := resources array:#(
|
109
|
442 |
'\c detail'
|
|
443 |
).
|
|
444 |
selectors := #(
|
|
445 |
detail
|
|
446 |
).
|
|
447 |
] ifFalse:[
|
|
448 |
labels := resources array:#(
|
|
449 |
'inspect'
|
|
450 |
'debug'
|
|
451 |
'-'
|
|
452 |
'resume'
|
|
453 |
'suspend'
|
|
454 |
'stop'
|
|
455 |
'abort'
|
|
456 |
'terminate'
|
|
457 |
'-'
|
|
458 |
'raise prio'
|
|
459 |
'lower prio'
|
|
460 |
).
|
|
461 |
selectors := #(
|
|
462 |
inspectProcess
|
|
463 |
debugProcess
|
|
464 |
nil
|
|
465 |
resumeProcess
|
|
466 |
suspendProcess
|
|
467 |
stopProcess
|
|
468 |
abortProcess
|
|
469 |
terminateProcess
|
|
470 |
nil
|
|
471 |
raisePrio
|
|
472 |
lowerPrio
|
|
473 |
).
|
|
474 |
updateProcess isNil ifTrue:[
|
|
475 |
labels := (resources array:#('update' '-')) , labels.
|
|
476 |
selectors := #(updateView nil) , selectors
|
|
477 |
].
|
85
|
478 |
].
|
|
479 |
|
|
480 |
m := PopUpMenu labels:labels
|
90
|
481 |
selectors:selectors.
|
85
|
482 |
|
109
|
483 |
m checkToggleAt:#detail put:showDetail.
|
85
|
484 |
^ m
|
|
485 |
!
|
19
|
486 |
|
143
|
487 |
terminateProcess
|
|
488 |
"terminate the selected process"
|
|
489 |
|
|
490 |
self selectedProcessesSend:#terminate
|
|
491 |
!
|
|
492 |
|
|
493 |
hideDead:aBoolean
|
|
494 |
hideDead := aBoolean
|
|
495 |
!
|
|
496 |
|
|
497 |
debugProcess
|
|
498 |
"open a debugger on the selected process"
|
|
499 |
|
|
500 |
self selectedProcessesDo:[:p |
|
|
501 |
Debugger openOn:p
|
|
502 |
]
|
|
503 |
!
|
|
504 |
|
|
505 |
abortProcess
|
|
506 |
"abort (raise AbortSignal in) the selected process"
|
|
507 |
|
|
508 |
self selectedProcessesDo:[:p |
|
|
509 |
p interruptWith:[AbortSignal raise]
|
|
510 |
]
|
|
511 |
!
|
|
512 |
|
|
513 |
inspectProcess
|
|
514 |
"open an inspector on the selected process"
|
|
515 |
|
|
516 |
self selectedProcessesSend:#inspect
|
|
517 |
!
|
|
518 |
|
|
519 |
detail
|
|
520 |
showDetail := showDetail not.
|
|
521 |
self updateView
|
|
522 |
!
|
|
523 |
|
|
524 |
resumeProcess
|
|
525 |
"resume the selected process (i.e. let it run) "
|
|
526 |
|
|
527 |
self selectedProcessesSend:#resume
|
|
528 |
!
|
|
529 |
|
92
|
530 |
stopProcess
|
|
531 |
"stop the selected process - not even interrupts will wake it up"
|
|
532 |
|
|
533 |
self selectedProcessesSend:#stop
|
|
534 |
!
|
|
535 |
|
19
|
536 |
suspendProcess
|
92
|
537 |
"suspend the selected process - interrupts will let it run again"
|
|
538 |
|
58
|
539 |
self selectedProcessesSend:#suspend
|
85
|
540 |
!
|
45
|
541 |
|
|
542 |
raisePrio
|
92
|
543 |
"raise the selected processes priority"
|
|
544 |
|
45
|
545 |
self selectedProcessesDo:[:p |
|
|
546 |
p priority:(p priority + 1)
|
|
547 |
]
|
85
|
548 |
!
|
45
|
549 |
|
|
550 |
lowerPrio
|
92
|
551 |
"lower the selected processes priority"
|
|
552 |
|
45
|
553 |
self selectedProcessesDo:[:p |
|
|
554 |
p priority:(p priority - 1)
|
|
555 |
]
|
19
|
556 |
! !
|
|
557 |
|
143
|
558 |
!ProcessMonitor methodsFor:'private'!
|
|
559 |
|
|
560 |
selectedProcessesDo:aBlock
|
|
561 |
|p nr sel|
|
85
|
562 |
|
143
|
563 |
sel := listView selection.
|
|
564 |
sel isNil ifTrue:[^ self].
|
|
565 |
(sel isKindOf:Collection) ifTrue:[
|
|
566 |
sel do:[:n |
|
|
567 |
nr := n - 2. "for headlines"
|
|
568 |
nr notNil ifTrue:[
|
|
569 |
nr > 0 ifTrue:[
|
|
570 |
p := processes at:nr.
|
|
571 |
p notNil ifTrue:[
|
|
572 |
aBlock value:p
|
|
573 |
]
|
|
574 |
]
|
|
575 |
]
|
|
576 |
]
|
85
|
577 |
] ifFalse:[
|
143
|
578 |
nr := sel - 2. "for headlines"
|
|
579 |
nr notNil ifTrue:[
|
|
580 |
nr > 0 ifTrue:[
|
|
581 |
p := processes at:nr.
|
|
582 |
p notNil ifTrue:[
|
|
583 |
aBlock value:p
|
|
584 |
]
|
|
585 |
]
|
|
586 |
]
|
85
|
587 |
].
|
143
|
588 |
!
|
|
589 |
|
|
590 |
selectedProcessesSend:aSelector
|
|
591 |
self selectedProcessesDo:[:p |
|
|
592 |
p perform:aSelector
|
|
593 |
].
|
|
594 |
self updateView.
|
85
|
595 |
! !
|
|
596 |
|
|
597 |
!ProcessMonitor methodsFor:'queries'!
|
|
598 |
|
105
|
599 |
preferredExtent
|
85
|
600 |
^ (font widthOf:self titleLine) + 40 @ 100
|
|
601 |
! !
|
|
602 |
|