summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2024-08-28 00:18:53 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2024-08-28 00:18:53 +0330
commite9d373a154f538ef316940a142f652dba1a9bea6 (patch)
tree1330afde6a7e695e6e334f12483c732eca90314e /src/main.c
initial commit
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
new file mode 100644
index 0000000..b7a97d1
--- /dev/null
+++ b/src/main.c
@@ -0,0 +1,32 @@
+#include "ui/tui.h"
+#include <unistd.h>
+#include <stdio.h>
+
+void on_button_click(MOUSE_ACTION mouse_action) {
+ printf("hello");
+ sleep(1);
+}
+
+WIDGET *ui_build(TUI *tui) {
+ return tui_make_box(
+ -1, -1,
+ tui_make_row(tui_make_widget_array(
+ 2,
+ tui_make_box(
+ 8, 2,
+ tui_make_button(tui_make_text("Hello, World!", COLOR_BLUE),
+ on_button_click),
+ COLOR_YELLOW),
+ tui_make_text("Hello, World!", COLOR_RED), 1)),
+ COLOR_MAGENTA);
+}
+
+int main() {
+ TUI *tui = tui_init();
+
+ tui_start_app(tui, ui_build);
+
+ tui_delete(tui);
+
+ return 0;
+}