#FEATURE by exept
class: PluggableAdaptor
comment/format in: #selectValue:
class: PluggableAdaptor class
comment/format in: #examples
--- a/PluggableAdaptor.st Thu Aug 01 14:24:40 2019 +0200
+++ b/PluggableAdaptor.st Sat Aug 10 09:26:45 2019 +0200
@@ -104,6 +104,21 @@
t open.
[exEnd]
+ choose one from alternatives (radioButton-like behavior):
+
+ [exBegin]
+ |m v|
+
+ m := #foo asValue.
+ v := HorizontalPanelView new.
+ v add:(Toggle on:((PluggableAdaptor on:m) selectValue:#foo) label:'foo' ).
+ v add:(Toggle on:((PluggableAdaptor on:m) selectValue:#bar) label:'bar' ).
+ v add:(Toggle on:((PluggableAdaptor on:m) selectValue:#baz) label:'baz' ).
+ v add:(Label label:'Current:' ).
+ v add:(Label new labelChannel:m ).
+ v open.
+ [exEnd]
+
extract values from a complex model:
[exBegin]
|model dialog name pId|
@@ -398,7 +413,7 @@
selectValue:something
"configure the adaptor to behave like a boolean value, returning
- true whenever the models value equals something"
+ true whenever the model's value equals something"
"/ getBlock := [:model | model value = something].
"/ putBlock := [:model :newValue | newValue ifTrue:[model value:something]].