123456789101112131415161718192021222324252627282930 |
- type Data {
- a: Bool,
- b: Maybe[Number],
- c: String,
- d: String
- };
- do Window.{show-at-center};
- do Window.{on-close}.{connect {os::exit 0}};
- do
- \ data := sync { Reactive { |Data| { a: No, b: None, c: '', d: 'Lorem Ipsum' } } },
- let (a,b,c,d) :=
- ((data proj |.(a)|),
- (data proj |.(b)|),
- (data proj |.(c)|),
- (data proj |.(d)|)),
- { merge [
- (InputCheckBox bind a),
- (InputComboBox bind b),
- (InputLineEdit bind c),
- (InputPlainTextEdit bind d),
- (ButtonClear.{activated}.{connect (c <- '')}),
- (ValueCheckBox bind a.{watch}.{map &(a) => if a: 'Yes', else: 'No'}),
- (ValueComboBox bind b.{watch}.{map &(b) => switch b: case Some b: b.{String}, case None: 'None', end}),
- (ValueLineEdit bind c.{watch}),
- (ValuePlainTextEdit bind d.{watch})
- ] };
|