summaryrefslogtreecommitdiff
path: root/test/gui/group.c
diff options
context:
space:
mode:
authorAdam NAILI2017-12-22 19:15:56 +0100
committerAdam NAILI2017-12-22 19:15:56 +0100
commit92c999f56a86f221e6d3dc2182b5b7f7e0e08231 (patch)
treee5e0bddb9c3636731695fd11b8c7aa1f74626b77 /test/gui/group.c
parente84ae1203b8cd7a51d93ec77a5a2663e7496eef5 (diff)
downloadmorpher-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/group.c')
-rw-r--r--test/gui/group.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/test/gui/group.c b/test/gui/group.c
index e3d25f3..555c246 100644
--- a/test/gui/group.c
+++ b/test/gui/group.c
@@ -7,9 +7,30 @@ static void test_group() {
7 Window window; 7 Window window;
8 window_init(&window, 1000, 512, "Coucou"); 8 window_init(&window, 1000, 512, "Coucou");
9 window_create(&window); 9 window_create(&window);
10 window.group_buttons->component.print_method(window.group_pictureframe); 10
11 MLV_wait_seconds(5); 11 Button button1;
12 window_free(&window); 12 Button button2;
13 Button button3;
14
15 button_init(&button1, "OK", 10, 500, 256, button_click_test);
16 button_init(&button2,"Bouton magique",10, 500,290, NULL);
17 button_init(&button3,"Très lonnggggg boooouttttooooon",10,0,0,button_click_test);
18
19 window_add_button(&window,&button1);
20 window_add_button(&window,&button2);
21 window_add_button(&window,&button3);
22
23 window_print_buttons(&window);
24 int mouse_x;
25 int mouse_y;
26 while(1){
27 if (MLV_get_mouse_button_state(MLV_BUTTON_LEFT) == MLV_PRESSED) {
28 MLV_get_mouse_position(&mouse_x, &mouse_y);
29 group_click_handler(mouse_x,mouse_y,&(window.group_buttons->component));
30 }
31 }
32 /*MLV_wait_seconds(15);
33 window_free(&window);*/
13} 34}
14 35
15int main() { 36int main() {