recreate was somehow corrupted ?!
authorClaus Gittinger <cg@exept.de>
Sat, 15 Jun 1996 16:27:12 +0200
changeset 871 c078c33c51ac
parent 870 2b7db80e7ad1
child 872 ae232ece067d
recreate was somehow corrupted ?!
Form.st
--- a/Form.st	Sat Jun 15 15:48:50 1996 +0200
+++ b/Form.st	Sat Jun 15 16:27:12 1996 +0200
@@ -1202,34 +1202,45 @@
     "reconstruct the form after a snapin"
 
     data notNil ifTrue:[
-	"
-	 create one from data
-	"
-	(depth == 1 or:[depth == device depth]) ifTrue:[
-	    drawableId := device createBitmapFromArray:data width:width height:height.
-	    Lobby registerChange:self. 
-	    ^ self
-	].
-	data := nil.
+        "
+         create one from data
+        "
+        (depth == 1 or:[depth == device depth]) ifTrue:[
+            drawableId := device createBitmapFromArray:data width:width height:height.
+            Lobby registerChange:self. 
+            drawableId notNil ifTrue:[
+                ^ self
+            ]
+        ].
+        'FORM: cannot recreate form' errorPrintCR.
     ].
     fileName notNil ifTrue:[
-	"
-	 create one from a file (mhmh - this seems X-specific and will vanish)
-	"
-	drawableId := device createBitmapFromFile:fileName for:self.
-	Lobby registerChange:self.
-	^ self
+        "
+         create one from a file (mhmh - this seems X-specific and will vanish)
+        "
+        self readFromFile:fileName.
+
+"/        drawableId := device createBitmapFromFile:fileName for:self.
+"/        Lobby registerChange:self.
+        drawableId notNil ifTrue:[
+            ^ self
+        ].
+        'FORM: cannot recreate file form: ' errorPrint. fileName errorPrintCR.
     ].
-    'FORM: cannot recreate form' errorPrintNL.
+
+    ^ self.
+
     "
      create an empty one
     "
     depth == 1 ifTrue:[
-	drawableId := device createBitmapWidth:width height:height
+        drawableId := device createBitmapWidth:width height:height
     ] ifFalse:[
-	drawableId := device createPixmapWidth:width height:height depth:device depth
+        drawableId := device createPixmapWidth:width height:height depth:device depth
     ].
     Lobby registerChange:self
+
+    "Modified: 15.6.1996 / 16:18:12 / cg"
 ! !
 
 !Form methodsFor:'inspecting'!
@@ -1531,6 +1542,6 @@
 !Form class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Form.st,v 1.52 1996-06-15 13:48:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Form.st,v 1.53 1996-06-15 14:27:12 cg Exp $'
 ! !
 Form initialize!