VDBStackApplication.st
changeset 25 e0f3744cd77d
parent 24 c33a063cb363
child 31 00f6de198c7f
--- a/VDBStackApplication.st	Mon Sep 22 22:50:28 2014 +0100
+++ b/VDBStackApplication.st	Mon Sep 22 23:49:05 2014 +0100
@@ -290,6 +290,17 @@
     "Modified: / 21-09-2014 / 23:52:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+updateInternalSelectionAfterThreadStopped: thread
+    | threadP frameP |
+
+    threadP := self internalListHolder value root 
+                    recursiveDetect:[ :e | e isThreadPresenter and:[ e thread == thread ] ].
+    frameP := threadP children first.
+    self internalSelectionHolder value: frameP
+
+    "Created: / 22-09-2014 / 23:21:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 updateSelection
     | internalSelection frame thread group |
 
@@ -317,32 +328,39 @@
     "Modified: / 22-09-2014 / 00:17:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-!VDBStackApplication methodsFor:'change & update-dekayed'!
+!VDBStackApplication methodsFor:'change & update-delayed'!
 
-delayedUpdateInternalList
-    self window sensor pushUserEvent: #updateInternalList for: self
+enqueueUpdateInternalList
+    self window sensor pushUserEvent:#updateInternalList for:self
 
     "Created: / 20-09-2014 / 23:05:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+enqueueUpdateInternalSelectionAfterThreadStopped: aGDBThread 
+    self window sensor pushUserEvent:#updateInternalSelectionAfterThreadStopped: for:self withArgument: aGDBThread
+
+    "Created: / 22-09-2014 / 23:15:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !VDBStackApplication methodsFor:'event handling'!
 
 onStoppedEvent: event
-    self delayedUpdateInternalList.
+    self enqueueUpdateInternalList.
+    self enqueueUpdateInternalSelectionAfterThreadStopped:event stoppedThread.
 
     "Created: / 17-09-2014 / 23:04:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 20-09-2014 / 23:08:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 22-09-2014 / 23:26:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 onThreadExitedEvent: event
-    self delayedUpdateInternalList.
+    self enqueueUpdateInternalList.
 
     "Created: / 18-09-2014 / 23:30:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 20-09-2014 / 23:08:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 onThreadGroupExitedEvent: event
-    self delayedUpdateInternalList.
+    self enqueueUpdateInternalList.
 
     "Created: / 18-09-2014 / 23:30:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 20-09-2014 / 23:08:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -353,7 +371,7 @@
 commonPostOpen
     "a common hook for postOpenWith:, postOpenAsSubcanvasWith: and postOpenAsDialogWith:."
 
-    self delayedUpdateInternalList
+    self enqueueUpdateInternalList
 
     "Created: / 18-09-2014 / 00:29:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 20-09-2014 / 23:50:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"