Launcher.st
changeset 815 573e5b6001f6
parent 783 0f64a5d1bad2
child 821 a81a0fb108d0
--- a/Launcher.st	Mon Oct 28 14:03:13 1996 +0100
+++ b/Launcher.st	Mon Oct 28 14:52:17 1996 +0100
@@ -2275,7 +2275,32 @@
     "Created: 12.5.1996 / 15:30:15 / cg"
 !
 
+findAndDestroyWindow
+    |v|
+
+    v := self findWindow.
+    v notNil ifTrue:[
+        v destroy.
+    ].
+
+    "Created: 28.10.1996 / 14:39:23 / cg"
+!
+
 findAndRaiseWindow
+    |v|
+
+    v := self findWindow.
+    v notNil ifTrue:[
+        v raiseDeiconified.
+    ].
+
+    "Modified: 28.10.1996 / 14:39:04 / cg"
+!
+
+findWindow
+    "a helper for find & destroy and find & raise operations;
+     let user choose a view and return it; return nil on cancel"
+
     |knownTopViews nameList box|
 
     knownTopViews := IdentitySet new.
@@ -2292,7 +2317,17 @@
 
     knownTopViews := knownTopViews asOrderedCollection.
     knownTopViews sort:[:v1 :v2 | v1 label < v2 label].
-    nameList := knownTopViews collect:[:v | v label].
+    nameList := knownTopViews collect:[:v | 
+                                        |isDead wg p|
+
+                                        ((wg := v windowGroup) notNil
+                                        and:[(p := wg process) notNil
+                                        and:[p state ~~ #dead]]) ifTrue:[
+                                            v label
+                                        ] ifFalse:[
+                                            v label , ' (dead ?)'
+                                        ]
+                                      ].
 
     box := ListSelectionBox new.
     box noEnterField.
@@ -2303,13 +2338,15 @@
         |v|
 
         v := knownTopViews at:box selectionIndex.
-        v raiseDeiconified.
         box destroy.
+        ^ v
     ].
+    box extent:400@300.
     box showAtPointer.
-
-    "Created: 15.10.1996 / 12:43:06 / cg"
+    ^ nil
+
     "Modified: 16.10.1996 / 12:41:39 / cg"
+    "Created: 28.10.1996 / 14:38:41 / cg"
 !
 
 fullScreenHardcopy
@@ -3356,8 +3393,9 @@
                                            '-'
                                            'view tree (all views)'
                                            'view tree'
-                                           'inspect view'
-                                           'destroy view'
+                                           'select & inspect view'
+                                           'select & destroy view'
+                                           'find & destroy ...'
                                          ))
                 selectors:#(
                                         #findAndRaiseWindow 
@@ -3366,6 +3404,7 @@
                                         #startWindowTreeView 
                                         #viewInspect 
                                         #viewDestroy 
+                                        #findAndDestroyWindow 
                            )
                 receiver:self).
 
@@ -3399,7 +3438,7 @@
                            )
                 receiver:self).
 
-    "Modified: 15.10.1996 / 12:42:47 / cg"
+    "Modified: 28.10.1996 / 14:40:03 / cg"
 !
 
 setupTranscriptIn:aView 
@@ -3675,5 +3714,5 @@
 !Launcher class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Launcher.st,v 1.205 1996-10-21 14:22:12 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Launcher.st,v 1.206 1996-10-28 13:52:17 cg Exp $'
 ! !