diff options
Diffstat (limited to 'test/gui/button.c')
-rw-r--r-- | test/gui/button.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/gui/button.c b/test/gui/button.c new file mode 100644 index 0000000..df3e04d --- /dev/null +++ b/test/gui/button.c | |||
@@ -0,0 +1,30 @@ | |||
1 | #include <gui/group.h> | ||
2 | #include <gui/window.h> | ||
3 | #include <gui/button.h> | ||
4 | #include <gui/component.h> | ||
5 | #include "MLV/MLV_all.h" | ||
6 | |||
7 | |||
8 | static void test_button() { | ||
9 | /* Window window; | ||
10 | window_init(&window, 1000, 512, "Coucou"); | ||
11 | window_create(&window); | ||
12 | Button button1; | ||
13 | button_init(&button1, "OK", 10, 500, 256, button_click_test); | ||
14 | button1.component.print_method(&button1); | ||
15 | int mouse_x; | ||
16 | int mouse_y; | ||
17 | while (1) { | ||
18 | if (MLV_get_mouse_button_state(MLV_BUTTON_LEFT) == MLV_PRESSED) { | ||
19 | MLV_get_mouse_position(&mouse_x, &mouse_y); | ||
20 | button1.component.click_handler(mouse_x, mouse_y, &(button1.component)); | ||
21 | } | ||
22 | }*/ | ||
23 | /*MLV_wait_seconds(10); | ||
24 | window_free(&window);*/ | ||
25 | } | ||
26 | |||
27 | int main() { | ||
28 | test_button(); | ||
29 | return 0; | ||
30 | } \ No newline at end of file | ||