aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
blob: 25c65127cfcba616d62bd653b237e781b63cff0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "mbuoy/view.hpp"
#include "mbuoy/ui/button.hpp"
#include "mbuoy/ui/label.hpp"

#include <cstdio>

void drawButton(const mbuoy::position& pos, const mbuoy::dimensions& dim)
{
    std::printf("[%d, %d, %d, %d]: button\n", pos.x, pos.y, dim.width, dim.height);
}

int main()
{
    auto test = mbuoy::view<
        mbuoy::label<
            mbuoy::string("Hey"),
            mbuoy::position(10, 100)>{},
        mbuoy::label<
            mbuoy::string("there"),
            mbuoy::position(10, 120)>{},
        mbuoy::button<
            mbuoy::position(10, 120),
            mbuoy::dimensions(40, 40),
            mbuoy::ondraw(drawButton)>{}
    >;

    test.render();
}