diff options
| author | Arslaan Pathan <[email protected]> | 2026-04-26 19:55:37 +1200 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-04-26 19:55:37 +1200 |
| commit | 6bd14230b3ed93e7eeab55d957db685c63a65069 (patch) | |
| tree | 6df64a6832eb5aece7a8364c765595df00b48dbc /tests/test_main.c | |
| parent | 15086bff2e32bf67f9a093b35b53b81a6b4851e0 (diff) | |
| download | saffron-6bd14230b3ed93e7eeab55d957db685c63a65069.tar.xz saffron-6bd14230b3ed93e7eeab55d957db685c63a65069.zip | |
Make it better
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; } |
