bug fixes for spec derived from channel
authorca
Sun, 12 Oct 1997 13:29:49 +0200
changeset 554 c32ed45bfc6e
parent 553 3535a0682ac7
child 555 adc507caec9e
bug fixes for spec derived from channel
SubCanvas.st
--- a/SubCanvas.st	Sat Oct 11 15:31:15 1997 +0200
+++ b/SubCanvas.st	Sun Oct 12 13:29:49 1997 +0200
@@ -100,7 +100,7 @@
     (specHolder := aValueHolder) notNil ifTrue:[
         specHolder addDependent:self
     ].
-    self spec:spec value
+
 ! !
 
 !SubCanvas methodsFor:'building'!
@@ -108,26 +108,24 @@
 rebuild
     "rebuild
     "
-    |win appl|
+    |win|
 
     scrolledView notNil ifTrue:[
         scrolledView destroySubViews
     ].
 
-    builder isNil ifTrue:[
-        builder := UIBuilder new
-    ].
     spec notNil ifTrue:[
         (win := spec) isSymbol ifTrue:[
-            (appl := client) isNil ifTrue:[
-                (appl := self application) isNil ifTrue:[
-                    ^ self
-                ]
+            client isNil ifTrue:[
+                ^ self
             ].
-            (win := appl class interfaceSpecFor:spec) isNil ifTrue:[
+            (win := client class interfaceSpecFor:spec) isNil ifTrue:[
                 ^ self
             ]
         ].
+        builder isNil ifTrue:[
+            builder := UIBuilder new
+        ].
         builder buildFromSpec:win in:scrolledView.
 
         self realized ifTrue:[
@@ -149,7 +147,14 @@
     "one of my models changed its value
     "
     changedObject == clientHolder ifTrue:[^ self client:(clientHolder value)].
-    changedObject == specHolder   ifTrue:[^ self spec:(specHolder value)].
+    changedObject == specHolder   ifTrue:[
+        client isNil ifTrue:[
+            (client := self application) notNil ifTrue:[
+                builder := client builder
+            ]
+        ].
+        ^ self spec:(specHolder value)
+    ].
 
     super update:something with:aParameter from:changedObject.
 
@@ -180,5 +185,5 @@
 !SubCanvas class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/SubCanvas.st,v 1.3 1997-10-11 13:31:15 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/SubCanvas.st,v 1.4 1997-10-12 11:29:49 ca Exp $'
 ! !