ValueHolder.st
changeset 62 194eb0590b1e
child 66 6ee963fd8e27
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ValueHolder.st	Tue May 02 01:06:45 1995 +0200
@@ -0,0 +1,44 @@
+ValueModel subclass:#ValueHolder 
+	 instanceVariableNames:'value changeMsg changeReceiver'
+	 classVariableNames:''
+	 poolDictionaries:''
+	 category:'ST80-Compatibility'
+!
+
+!ValueHolder class methodsFor:'instance creation'!
+
+with:anObject
+    ^ (super new) value:anObject
+!
+
+newString
+    ^ self with:''
+!
+
+newBoolean
+    ^ self with:false
+! !
+
+!ValueHolder methodsFor:'accessing'!
+
+onChangeSend:selector to:someone
+    changeMsg := selector.
+    changeReceiver := someone
+!
+
+value:anObject
+    |oldValue|
+
+    oldValue := value.
+    value := anObject.
+    self changed:#value.
+    changeReceiver notNil ifTrue:[
+	changeMsg notNil ifTrue:[
+	    changeReceiver perform:changeMsg
+	]
+    ]
+!
+
+value
+    ^ value
+! !