From e9d373a154f538ef316940a142f652dba1a9bea6 Mon Sep 17 00:00:00 2001 From: A404M Date: Wed, 28 Aug 2024 00:18:53 +0330 Subject: initial commit --- src/main.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main.c (limited to 'src/main.c') 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 +#include + +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; +} -- cgit v1.2.3