diff options
Diffstat (limited to 'tests/test_main.c')
| -rw-r--r-- | tests/test_main.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/test_main.c b/tests/test_main.c index c3ea050..39b41f2 100644 --- a/tests/test_main.c +++ b/tests/test_main.c @@ -52,20 +52,21 @@ int main(void) { test2->h = 72; test2->draw = my_test_draw; - /* lunatic method 3 */ - SaffronWidget* test3 = saffron_widget_new(); - test3->w = 200; - test3->h = 73; - test3->draw = my_test_draw; + SDL_Color color = {255, 255, 255, 255}; + TTF_Font* font = TTF_OpenFont("/usr/share/fonts/fantasque-sans-mono/FantasqueSansMono-Regular.otf", 24); + SaffronText* test3 = saffron_text_new("Mangoes", font, color); + /* become lunatic, add custom clickhandler to.. text????????????? */ + ((SaffronWidget*)test3)->on_click = my_test_onclick; saffron_widget_add_child(window->root, test); saffron_widget_add_child(window->root, box); saffron_widget_add_child(box, test2); - saffron_widget_add_child(box, test3); + saffron_widget_add_child(box, (SaffronWidget*)test3); saffron_window_main(window); saffron_window_free(window); + TTF_CloseFont(font); saffron_quit(); return 0; } |
