diff options
author | Adam NAILI | 2017-12-22 19:15:56 +0100 |
---|---|---|
committer | Adam NAILI | 2017-12-22 19:15:56 +0100 |
commit | 92c999f56a86f221e6d3dc2182b5b7f7e0e08231 (patch) | |
tree | e5e0bddb9c3636731695fd11b8c7aa1f74626b77 /test/gui/button.c | |
parent | e84ae1203b8cd7a51d93ec77a5a2663e7496eef5 (diff) | |
download | morpher-92c999f56a86f221e6d3dc2182b5b7f7e0e08231.tar.gz |
Successful test for the group management and button handling. Buttons are placed in the right spots thanks to group position handling
Diffstat (limited to 'test/gui/button.c')
-rw-r--r-- | test/gui/button.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/test/gui/button.c b/test/gui/button.c index 58270ef..df3e04d 100644 --- a/test/gui/button.c +++ b/test/gui/button.c | |||
@@ -1,4 +1,30 @@ | |||
1 | // | 1 | #include <gui/group.h> |
2 | // Created by adam on 16/12/17. | 2 | #include <gui/window.h> |
3 | // | 3 | #include <gui/button.h> |
4 | #include <gui/component.h> | ||
5 | #include "MLV/MLV_all.h" | ||
4 | 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 | ||