mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-28 12:54:45 +00:00
23 lines
512 B
C++
23 lines
512 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...){
|
|
auto &counter = component.counter;
|
|
counter.set(counter.get() + 1);
|
|
});
|
|
|
|
component.minus_clicked.set_handler([](auto...){
|
|
auto &counter = component.counter;
|
|
counter.set(counter.get() - 1);
|
|
});
|
|
|
|
sixtyfps::run(&component);
|
|
|
|
}
|