aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
blob: 590f1ed594e681ea7a48e401bf749e4b0e3d3800 (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
#include "view.hpp"
#include "ui/button.hpp"
#include "ui/label.hpp"

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();
}