eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'IndirectValue':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: IndirectValue


Inheritance:

   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

Description:


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.

copyright

COPYRIGHT (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.

Class protocol:

instance creation
o  for: aValueHolder
return a new IndirectValue presenting aValueHolder


Instance protocol:

accessing
o  setValue: newValue
physically set my value, without change notifications

o  setValueHolder: aValueHolder
change my holder

o  value
return my value

o  valueHolder
return my valueHolder

o  valueHolder: aValueHolder
change my holder

change & update
o  update: something with: aParameter from: someone
the holder I depend on has changed - send a change notification to my dependents


Examples:


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.


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 14 Oct 2024 01:34:38 GMT