mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 05:44:52 +00:00
Make property conneciton binding in the C++
(somehow plus/minus is not working yet)
This commit is contained in:
parent
e227f8a46e
commit
74898a1386
4 changed files with 21 additions and 15 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue