write back specification to properties after undo modification
authorca
Tue, 04 Mar 1997 14:23:26 +0100
changeset 80 3316c52ef2b7
parent 79 33212fbe9766
child 81 7493e2437af5
write back specification to properties after undo modification of a spec
UIPainterView.st
--- a/UIPainterView.st	Tue Mar 04 12:29:48 1997 +0100
+++ b/UIPainterView.st	Tue Mar 04 14:23:26 1997 +0100
@@ -844,6 +844,7 @@
     |spec builder|
 
     self removeAll.
+
     spec    := UISpecification from:specOrSpecArray.
     builder := UIBuilder new.
     spec window setupView:self topView for:builder.
@@ -1562,20 +1563,24 @@
 undoSpecModify:aViewId
     "undo method when changing the specification for an object
     "
-    |builder view spec v|
+    |builder view spec v props|
 
     (view := self findViewWithId:aViewId) notNil ifTrue:[
         spec := self specFor:view.
         view := nil.
 
         undoHistory addUndoBlock:[
-            (view := self findViewWithId:aViewId) notNil ifTrue:[
+            props := self propertyOfIdentifier:aViewId.
+            props notNil ifTrue:[
+                view    := props view.
                 builder := UIBuilder new.
+                props spec:spec.
+
                 spec needsRebuildForAttributes ifTrue:[
                     v := spec buildViewWithLayoutFor:builder in:view superView.
                     v realize.    
                     view destroy.
-                    view become:v.    
+                    view become:v
                 ] ifFalse:[
                     spec setAttributesIn:view with:builder.
                     self elementChangedSize:view.