|
Class: IndirectValue
Object
|
+--Model
|
+--ValueModel
|
+--IndirectValue
- Package:
- stx:libview2
- Category:
- Interface-Support-Models
- Version:
- rev:
1.12
date: 2023/07/15 18:33:29
- user: cg
- file: IndirectValue.st directory: libview2
- module: stx stc-classLibrary: libview2
IndirectValue refers to another valueHolder and presents that holder's value
as my own value.
However, the holder can be changed, which results in a change message from myself.
Can be used if a valueHolder is needed which represents different values over
time, for example, a line/column holder for a notebook-like multi-codeView
application, where the line/col holder is switched whenever the tab is switched.
(use an IndirectValue as holder of the line/col labels).
Another possible use is to synchronize two notebools via a common valueHolder,
which is used as indirect-value for the two individual indirect-selection-valueholders.
copyrightCOPYRIGHT (c) 2003 by eXept Software AG
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.
instance creation
-
for: aValueHolder
-
return a new IndirectValue presenting aValueHolder
accessing
-
setValue: newValue
-
physically set my value, without change notifications
-
setValueHolder: aValueHolder
-
change my holder
-
value
-
return my value
-
valueHolder
-
return my valueHolder
-
valueHolder: aValueHolder
-
change my holder
change & update
-
update: something with: aParameter from: someone
-
the holder I depend on has changed - send a change notification to my dependents
a label alternatively showing the value of 2 other valueHolders:
|holder1 holder2 indirVal lbl|
holder1 := '1' asValue.
holder2 := '2' asValue.
indirVal := IndirectValue for:holder1.
lbl := Label new.
lbl labelChannel:indirVal.
lbl open.
lbl waitUntilVisible.
Delay waitForSeconds:2.
indirVal valueHolder:holder2.
Delay waitForSeconds:2.
indirVal valueHolder:holder1.
|
|