class: NoteBookView
authorClaus Gittinger <cg@exept.de>
Thu, 07 May 2015 16:07:21 +0200
changeset 4759 4b58c1136d85
parent 4758 1095f8fdf167
child 4760 988451c16c3e
class: NoteBookView changed: #update:with:from: FIX race condition: if list of tabs changes due to an asynchronous change-notification from another process, while we are redrawing (i.e. fast changes triggered by a background process), ensure that the update is synchronized by pushing it onto my event queue.
NoteBookView.st
--- a/NoteBookView.st	Wed May 06 15:05:19 2015 +0200
+++ b/NoteBookView.st	Thu May 07 16:07:21 2015 +0200
@@ -11,6 +11,8 @@
 "
 "{ Package: 'stx:libwidg2' }"
 
+"{ NameSpace: Smalltalk }"
+
 View subclass:#NoteBookView
 	instanceVariableNames:'list listHolder foregroundColor backgroundColor selection enabled
 		action useIndex direction numberOfLines selectConditionBlock
@@ -1180,10 +1182,24 @@
     changedObject == listHolder ifTrue:[
         something == #at: ifTrue:[
             "/ a single items label has changed
-            self tabAtIndex:aParameter put:(listHolder value at:aParameter).
+            (self windowGroup notNil and:[Processor activeProcess ~~ self windowGroup process]) ifTrue:[
+                self sensor pushAction:
+                    [ 
+                        self tabAtIndex:aParameter put:(listHolder value at:aParameter)
+                    ]
+            ] ifFalse:[
+                self tabAtIndex:aParameter put:(listHolder value at:aParameter).
+            ].
             ^ self.
         ].
-        self list:(listHolder value).
+        (self windowGroup notNil and:[Processor activeProcess ~~ self windowGroup process]) ifTrue:[
+            self sensor pushAction:
+                [ 
+                    self list:(listHolder value) 
+                ]
+        ] ifFalse:[
+            self list:(listHolder value).
+        ].
         ^ self
     ].
 
@@ -3783,10 +3799,10 @@
 !NoteBookView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/NoteBookView.st,v 1.190 2014-12-21 23:32:28 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/NoteBookView.st,v 1.191 2015-05-07 14:07:21 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg2/NoteBookView.st,v 1.190 2014-12-21 23:32:28 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/NoteBookView.st,v 1.191 2015-05-07 14:07:21 cg Exp $'
 ! !