--- a/ValueHolder.st Sat May 06 16:15:18 1995 +0200
+++ b/ValueHolder.st Tue May 09 02:23:22 1995 +0200
@@ -1,5 +1,5 @@
ValueModel subclass:#ValueHolder
- instanceVariableNames:'value changeMsg changeReceiver'
+ instanceVariableNames:'value'
classVariableNames:''
poolDictionaries:''
category:'Interface-Support'
@@ -7,13 +7,31 @@
!ValueHolder class methodsFor:'documentation'!
+copyright
+"
+ COPYRIGHT (c) 1995 by Claus Gittinger
+ All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice. This software may not
+ be provided or otherwise made available to, or used by, any
+ other person. No title to or ownership of the software is
+ hereby transferred.
+"
+!
+
+version
+"
+$Header: /cvs/stx/stx/libview2/ValueHolder.st,v 1.4 1995-05-09 00:22:53 claus Exp $
+"
+!
+
documentation
"
- a valueHolder can me used as a model for editFields, buttons etc.
+ a valueHolder can be used as a model for editFields, buttons etc.
It stores some value internally, and sends update messages to its
dependents when changed.
- In addition, a specific message (changeMsg) can be sent to a specific
- object (changeObject) when the value is changed.
Notice: this class was implemented using protocol information
from alpha testers - it may not be complete or compatible to
@@ -27,7 +45,7 @@
with:anObject
"return a new ValueHolder holding anObject as initial value"
- ^ (super new) value:anObject
+ ^ (super new) setValue:anObject
!
newString
@@ -57,29 +75,10 @@
!ValueHolder methodsFor:'accessing'!
-onChangeSend:selector to:someone
- "set the selector and receiver for a message sent when my value changes."
-
- changeMsg := selector.
- changeReceiver := someone
-!
+setValue:anObject
+ "set my value without notification."
-value:anObject
- "set my value. Tell dependents and (optionally) the changeReceiver
- about that change.
- Typically, this is sent from a view which operates on myself.
- The dependents are typically other views or the application."
-
- |oldValue|
-
- oldValue := value.
value := anObject.
- self changed:#value.
- changeReceiver notNil ifTrue:[
- changeMsg notNil ifTrue:[
- changeReceiver perform:changeMsg
- ]
- ]
!
value