aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp26
1 files changed, 26 insertions, 0 deletions
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();
+}
+