Get rid of the context in properties/signal

This commit is contained in:
Olivier Goffart 2020-07-13 18:49:06 +02:00
parent ab7ae9f3e2
commit e00491811b
25 changed files with 389 additions and 653 deletions

View file

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