diff options
Diffstat (limited to 'test/gui/pictureframe.c')
-rw-r--r-- | test/gui/pictureframe.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/gui/pictureframe.c b/test/gui/pictureframe.c new file mode 100644 index 0000000..a47eaa0 --- /dev/null +++ b/test/gui/pictureframe.c | |||
@@ -0,0 +1,40 @@ | |||
1 | #include <gui/group.h> | ||
2 | #include <gui/window.h> | ||
3 | #include "MLV/MLV_all.h" | ||
4 | |||
5 | |||
6 | static void test_pictureframe() { | ||
7 | Window window; | ||
8 | window_init(&window, 1000, 512, "Coucou"); | ||
9 | window_create(&window); | ||
10 | |||
11 | PictureFrame pictureFrame1; | ||
12 | PictureFrame pictureFrame2; | ||
13 | |||
14 | Morphing *morphing = morphing_create(500,250); | ||
15 | Canvas canvas; | ||
16 | canvas_init(&canvas,500,250); | ||
17 | |||
18 | pictureframe_init(&pictureFrame1,500,250,0,0,pictureframe_origin_split,morphing,&canvas); | ||
19 | pictureframe_init(&pictureFrame2,500,250,0,0,pictureframe_target_split,morphing,&canvas); | ||
20 | |||
21 | window_add_pictureframe(&window,&pictureFrame1); | ||
22 | window_add_pictureframe(&window,&pictureFrame2); | ||
23 | |||
24 | window_print_pictureframes(&window); | ||
25 | int mouse_x; | ||
26 | int mouse_y; | ||
27 | while(1){ | ||
28 | if (MLV_get_mouse_button_state(MLV_BUTTON_LEFT) == MLV_PRESSED) { | ||
29 | MLV_get_mouse_position(&mouse_x, &mouse_y); | ||
30 | group_click_handler(mouse_x,mouse_y,&(window.group_pictureframe->component)); | ||
31 | } | ||
32 | } | ||
33 | /*MLV_wait_seconds(15); | ||
34 | window_free(&window);*/ | ||
35 | } | ||
36 | |||
37 | int main() { | ||
38 | test_pictureframe(); | ||
39 | return 0; | ||
40 | } \ No newline at end of file | ||