UIPainterView.st
changeset 1173 7b5f40822819
parent 1092 60e029255679
child 1191 32bb9f029ad2
--- a/UIPainterView.st	Wed Jul 07 22:56:56 1999 +0200
+++ b/UIPainterView.st	Wed Jul 07 22:58:19 1999 +0200
@@ -1639,11 +1639,20 @@
 
 !
 
-rebuildView:aView fromSpec:aSpec withBuilder:aBuilder
-    |v|
+rebuildView:aView fromSpec:aSpec withBuilder:aBuilderOrNil
+    |v builder|
+
+    (builder := aBuilderOrNil) isNil ifTrue:[
+        "/ create a dummy builder
+        builder := UIBuilder new isEditing:true.
+        className notNil ifTrue:[
+            builder applicationClass:(self resolveName:className).
+        ].
+    ].
 
     aSpec needsRebuildForAttributes ifTrue:[
-        v := aSpec buildViewWithLayoutFor:aBuilder in:(self findContainerOfView:aView).
+        "/ needs a full rebuild (in case view class depends upon spec-attribute)
+        v := aSpec buildViewWithLayoutFor:builder in:(self findContainerOfView:aView).
         v realize.    
         aView destroy.
         device sync.
@@ -1651,7 +1660,7 @@
         aView becomeSameAs:v.
         inputView raise.
     ] ifFalse:[
-        aSpec setAttributesIn:aView with:aBuilder.
+        aSpec setAttributesIn:aView with:builder.
         self elementChangedSize:aView.
     ].
 
@@ -1683,7 +1692,7 @@
 updateFromSpec:aSpec
     "update current selected view from specification
     "
-    |props name builder|
+    |props name|
 
     aSpec class == WindowSpec ifTrue:[
          ^ treeView canvasSpec:aSpec
@@ -1692,10 +1701,6 @@
     self singleSelection notNil ifTrue:[
         self withSelectionHiddenDo:[
             self transaction:#specification selectionDo:[:aView|
-                builder := UIBuilder new isEditing:true.
-                className notNil ifTrue:[
-                    builder applicationClass:(self resolveName:className).
-                ].
                 props   := self propertyOfView:aView.
                 name    := (aSpec name) withoutSeparators.
 
@@ -1706,7 +1711,7 @@
                 ].
                 aSpec name:name.
                 self createUndoSpecModify:props.
-                self rebuildView:aView fromSpec:aSpec withBuilder:builder.
+                self rebuildView:aView fromSpec:aSpec withBuilder:nil.
                 props spec:(aSpec copy).
                 treeView propertyChanged:props.
             ]
@@ -1892,20 +1897,16 @@
 undoSpecModify:args
     "undo method when changing a spec; see 'createUndoSpecModify:'
     "
-    |builder view spec props|
+    |view spec props|
 
     props := self propertyOfIdentifier:(args at:2).
 
     props notNil ifTrue:[
         view    := props view.
         spec    := args at:1.
-        builder := UIBuilder new isEditing:true.
 
-        className notNil ifTrue:[
-            builder applicationClass:(self resolveName:className).
-        ].
         props spec:spec.
-        self rebuildView:view fromSpec:spec withBuilder:builder.
+        self rebuildView:view fromSpec:spec withBuilder:nil.
         treeView propertyChanged:props.
     ]
 ! !