mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
23 lines
520 B
C++
23 lines
520 B
C++
#include "hello.h"
|
|
#include <iostream>
|
|
|
|
int main() {
|
|
static Hello component;
|
|
|
|
component.foobar.set_handler([](auto...){
|
|
std::cout << "Hello from C++" << std::endl;
|
|
});
|
|
|
|
component.plus_clicked.set_handler([](auto ctx){
|
|
auto &counter = component.counter;
|
|
counter.set(counter.get(ctx) + 1);
|
|
});
|
|
|
|
component.minus_clicked.set_handler([](auto ctx){
|
|
auto &counter = component.counter;
|
|
counter.set(counter.get(ctx) - 1);
|
|
});
|
|
|
|
sixtyfps::run(&component);
|
|
|
|
}
|