Make property conneciton binding in the C++

(somehow plus/minus is not working yet)
This commit is contained in:
Olivier Goffart 2020-05-28 14:52:11 +02:00
parent e227f8a46e
commit 74898a1386
4 changed files with 21 additions and 15 deletions

View file

@ -8,14 +8,14 @@ int main() {
std::cout << "Hello from C++" << std::endl;
});
component.plus_clicked.set_handler([](auto...){
component.plus_clicked.set_handler([](auto ctx){
auto &counter = component.counter;
counter.set(counter.get(nullptr) + 1);
counter.set(counter.get(ctx) + 1);
});
component.minus_clicked.set_handler([](auto...){
component.minus_clicked.set_handler([](auto ctx){
auto &counter = component.counter;
counter.set(counter.get(nullptr) - 1);
counter.set(counter.get(ctx) - 1);
});
sixtyfps::run(&component);