Form.st
branchjv
changeset 7365 05f5fe42c919
parent 7315 aed1314a2448
parent 7355 b54b8aebbb90
child 7385 f51cdcfd2162
--- a/Form.st	Mon May 09 21:41:22 2016 +0200
+++ b/Form.st	Wed May 11 09:38:32 2016 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -260,7 +262,7 @@
 width:w height:h depth:d onDevice:aDevice
     "create a new form with depth d on device, aDevice"
 
-    ^ (self onDevice:aDevice) width:w height:h depth:d
+    ^ (self onDevice:aDevice) width:w height:h depth:d.
 
     "Modified: 18.1.1997 / 18:26:03 / cg"
 !
@@ -1171,7 +1173,6 @@
 	aStream reset.
 	^MIMEDocument contentType: MIMEDocument contentTypeGif content: aStream
 ! !
-
 !Form methodsFor:'converting'!
 
 asForm
@@ -1720,7 +1721,8 @@
 !
 
 width:w height:h depth:d
-    "actual create of an arbitrary deep form (but, must be supported by device)"
+    "actual create of an arbitrary deep form (but, must be supported by device).
+     Return nil (after raising a notification) if the allocation failed"
 
     ((w == 0) or:[h == 0]) ifTrue:[
         self error:'invalid form extent'.
@@ -1738,8 +1740,8 @@
         ].
     ].
     device notNil ifTrue:[
-        gc createPixmapWidth:w height:h depth:d.
-        realized := true.
+        (gc createPixmapWidth:w height:h depth:d) isNil ifTrue:[^nil].
+        realized := self drawableId notNil.
     ].
 !
 
@@ -1976,6 +1978,10 @@
     ^ '$Header$'
 !
 
+version_CVS
+    ^ '$Header$'
+!
+
 version_HG
 
     ^ '$Changeset: <not expanded> $'