mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 13:51:13 +00:00
22 lines
545 B
C++
22 lines
545 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::ComponentWindow window;
|
|
window.run(&component);
|
|
}
|