ConvertedValue.st
changeset 2222 e376d56f37a5
parent 258 9d218cd753c0
child 3855 1db7742d33ad
equal deleted inserted replaced
2221:52803ae96560 2222:e376d56f37a5
       
     1 "{ Package: 'stx:libview2' }"
       
     2 
     1 ValueHolder subclass:#ConvertedValue
     3 ValueHolder subclass:#ConvertedValue
     2 	instanceVariableNames:'conversion'
     4 	instanceVariableNames:'conversion'
     3 	classVariableNames:''
     5 	classVariableNames:''
     4 	poolDictionaries:''
     6 	poolDictionaries:''
     5 	category:'Interface-Support-Models'
     7 	category:'Interface-Support-Models'
    19 	converter := ConvertedValue new
    21 	converter := ConvertedValue new
    20 			conversion:[:input | input == true
    22 			conversion:[:input | input == true
    21 						ifTrue:[Color red]
    23 						ifTrue:[Color red]
    22 						ifFalse:[Color blue]];
    24 						ifFalse:[Color blue]];
    23 			value:false.
    25 			value:false.
    24         
    26 
    25 
    27 
    26 	toggle := Toggle label:'change color'.
    28 	toggle := Toggle label:'change color'.
    27 	toggle controller pressChannel:converter.
    29 	toggle controller pressChannel:converter.
    28 
    30 
    29 	label := Label label:'see me changing'.
    31 	label := Label label:'see me changing'.
    40 "
    42 "
    41 ! !
    43 ! !
    42 
    44 
    43 !ConvertedValue methodsFor:'accessing'!
    45 !ConvertedValue methodsFor:'accessing'!
    44 
    46 
    45 conversion:aBlock 
    47 conversion:aBlock
    46     conversion := aBlock
    48     conversion := aBlock
    47 !
    49 !
    48 
    50 
    49 initialValue:someValue
    51 initialValue:someValue
    50     self value:someValue
    52     self value:someValue
    55 ! !
    57 ! !
    56 
    58 
    57 !ConvertedValue class methodsFor:'documentation'!
    59 !ConvertedValue class methodsFor:'documentation'!
    58 
    60 
    59 version
    61 version
    60     ^ '$Header: /cvs/stx/stx/libview2/ConvertedValue.st,v 1.4 1996-05-10 16:42:53 cg Exp $'
    62     ^ '$Header: /cvs/stx/stx/libview2/ConvertedValue.st,v 1.5 2006-09-15 18:02:35 cg Exp $'
    61 ! !
    63 ! !