diff options
author | Marvin Borner | 2021-03-28 14:01:53 +0200 |
---|---|---|
committer | Marvin Borner | 2021-03-28 14:01:53 +0200 |
commit | 60750501da4eb0c020e971b45ae3a964c903e12d (patch) | |
tree | fc95ff546a7acaa22327bd27dc098230f820c531 /apps/window.c | |
parent | ba2c07447ba1278d8ad38ca58a8ae94c82d2d008 (diff) |
Fun with widgets
Diffstat (limited to 'apps/window.c')
-rw-r--r-- | apps/window.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/window.c b/apps/window.c index 4dbf9dc..de397a9 100644 --- a/apps/window.c +++ b/apps/window.c @@ -4,10 +4,24 @@ #include <libgui/gui.h> #include <print.h> +static void mousemove(vec2 pos) +{ + log("%d %d\n", pos.x, pos.y); +} + int main(void) { u32 win; assert((win = gui_new_window()) > 0); + + u32 main; + assert((main = gui_new_widget(win, gui_window_size(win), vec2(0, 0))) > 0); + + assert(gui_fill(win, main, COLOR_BLACK) == EOK); + assert(gui_redraw_widget(win, main) == EOK); + + assert(gui_listen_widget(win, main, GUI_LISTEN_MOUSEMOVE, (u32)mousemove) == EOK); + gui_loop(); return 0; } |