mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 13:51:13 +00:00
Get rid of the context in properties/signal
This commit is contained in:
parent
ab7ae9f3e2
commit
e00491811b
25 changed files with 389 additions and 653 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue