*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Mon, 28 Jul 1997 12:54:19 +0200
changeset 676 40945340dc59
parent 675 655134e5e064
child 677 8a02edbff4f5
*** empty log message ***
WinBuilder.st
WindowBuilder.st
--- a/WinBuilder.st	Mon Jul 28 12:53:24 1997 +0200
+++ b/WinBuilder.st	Mon Jul 28 12:54:19 1997 +0200
@@ -318,15 +318,9 @@
      created and added to the bindings.
      Otherwise, the existing binding is returned."
 
-    |holder|
+    ^ self valueAspectFor:aKey initialValue:false
 
-    (holder := self bindingAt:aKey) isNil ifTrue:[
-        self aspectAt:aKey put:(holder :=  false asValue).
-    ].
-    ^ holder
-
-    "Modified: 28.7.1997 / 12:44:28 / cg"
-    "Created: 28.7.1997 / 12:51:46 / cg"
+    "Modified: 28.7.1997 / 12:53:57 / cg"
 !
 
 nilValueAspectFor:aKey
@@ -335,15 +329,26 @@
      created and added to the bindings.
      Otherwise, the existing binding is returned."
 
+    ^ self valueAspectFor:aKey initialValue:nil
+
+    "Modified: 28.7.1997 / 12:54:06 / cg"
+!
+
+valueAspectFor:aKey initialValue:initialValue
+    "helper (common code) to generate a valueHolder aspect if required.
+     If no binding exists for aKey, a valueHolder holding initialValue is
+     created and added to the bindings.
+     Otherwise, the existing binding is returned."
+
     |holder|
 
     (holder := self bindingAt:aKey) isNil ifTrue:[
-        self aspectAt:aKey put:(holder :=  nil asValue).
+        self aspectAt:aKey put:(holder :=  initialValue asValue).
     ].
     ^ holder
 
-    "Modified: 28.7.1997 / 12:44:28 / cg"
-    "Created: 28.7.1997 / 12:51:40 / cg"
+    "Created: 28.7.1997 / 12:53:45 / cg"
+    "Modified: 28.7.1997 / 12:54:13 / cg"
 ! !
 
 !WindowBuilder methodsFor:'building'!
@@ -751,5 +756,5 @@
 !WindowBuilder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/Attic/WinBuilder.st,v 1.46 1997-07-28 10:53:24 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/Attic/WinBuilder.st,v 1.47 1997-07-28 10:54:19 cg Exp $'
 ! !
--- a/WindowBuilder.st	Mon Jul 28 12:53:24 1997 +0200
+++ b/WindowBuilder.st	Mon Jul 28 12:54:19 1997 +0200
@@ -318,15 +318,9 @@
      created and added to the bindings.
      Otherwise, the existing binding is returned."
 
-    |holder|
+    ^ self valueAspectFor:aKey initialValue:false
 
-    (holder := self bindingAt:aKey) isNil ifTrue:[
-        self aspectAt:aKey put:(holder :=  false asValue).
-    ].
-    ^ holder
-
-    "Modified: 28.7.1997 / 12:44:28 / cg"
-    "Created: 28.7.1997 / 12:51:46 / cg"
+    "Modified: 28.7.1997 / 12:53:57 / cg"
 !
 
 nilValueAspectFor:aKey
@@ -335,15 +329,26 @@
      created and added to the bindings.
      Otherwise, the existing binding is returned."
 
+    ^ self valueAspectFor:aKey initialValue:nil
+
+    "Modified: 28.7.1997 / 12:54:06 / cg"
+!
+
+valueAspectFor:aKey initialValue:initialValue
+    "helper (common code) to generate a valueHolder aspect if required.
+     If no binding exists for aKey, a valueHolder holding initialValue is
+     created and added to the bindings.
+     Otherwise, the existing binding is returned."
+
     |holder|
 
     (holder := self bindingAt:aKey) isNil ifTrue:[
-        self aspectAt:aKey put:(holder :=  nil asValue).
+        self aspectAt:aKey put:(holder :=  initialValue asValue).
     ].
     ^ holder
 
-    "Modified: 28.7.1997 / 12:44:28 / cg"
-    "Created: 28.7.1997 / 12:51:40 / cg"
+    "Created: 28.7.1997 / 12:53:45 / cg"
+    "Modified: 28.7.1997 / 12:54:13 / cg"
 ! !
 
 !WindowBuilder methodsFor:'building'!
@@ -751,5 +756,5 @@
 !WindowBuilder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.46 1997-07-28 10:53:24 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.47 1997-07-28 10:54:19 cg Exp $'
 ! !