« Return to Thread: Handling ui feedback loops

Handling ui feedback loops

by Steven W. Riggins :: Rate this Message:

Reply to Author | View in Thread

I have a input field and when I change the value of the tweak field,  
its mirrored into the field.  I also use this field as a input field,  
so I want to know when the value changed, and update my model.  
Problem is, I set the field, I get a changed event, I convert the  
field string gto a number, set my model, which updates the field, and  
around and around I go.

propertyValueAt: key put: newValue with: changeEvent
        "Store the value of my property at key"
        | oldValue |
        myProperties ifNil:[myProperties := IdentityDictionary new].
        oldValue := myProperties atProperty: key put: newValue.
        oldValue == newValue ifTrue:[^newValue].
        self signalChanged: changeEvent from: oldValue to: newValue.
        ^newValue

Does ==, which fails because '123' == (123 asString) fails.

WHats the proper pattern for this use of tweak fields and input fields?
_______________________________________________
Tweak mailing list
Tweak@...
http://impara.de/mailman/listinfo/tweak

 « Return to Thread: Handling ui feedback loops