This commit is contained in:
Olivier Goffart 2020-05-28 17:11:05 +02:00
parent dc276290e9
commit 619e21295d
4 changed files with 26 additions and 33 deletions

View file

@ -1,23 +1,21 @@
#include "hello.h"
#include <iostream>
int main() {
int main()
{
static Hello component;
component.foobar.set_handler([](auto...){
std::cout << "Hello from C++" << std::endl;
});
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 ctx) {
auto &counter = component.counter;
counter.set(counter.get(ctx) + 1);
});
component.minus_clicked.set_handler([](auto ctx){
component.minus_clicked.set_handler([](auto ctx) {
auto &counter = component.counter;
counter.set(counter.get(ctx) - 1);
});
sixtyfps::run(&component);
}