From 00f84e3b984904e36cbee502a470003ecd7d09cf Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sat, 10 Aug 2024 10:46:54 -0400 Subject: initial upload --- main.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 main.cpp (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..590f1ed --- /dev/null +++ b/main.cpp @@ -0,0 +1,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(); +} + -- cgit v1.2.3