#include #include #include static void saffron_button_draw(SaffronWidget* widget, SDL_Renderer* renderer) { // do stuff here } SaffronButton* saffron_button_new(bool enabled, void (*callback)(SaffronButton* self), int width, int height) { SaffronButton* button = malloc(sizeof(SaffronButton)); saffron_widget_init((SaffronWidget*)button); ((SaffronWidget*)button)->type = SAFFRON_WIDGET_BUTTON; ((SaffronWidget*)button)->draw = saffron_button_draw; button->callback = callback; button->enabled = enabled; button->base = *saffron_box_new(SAFFRON_ORIENTATION_HORIZONTAL, SAFFRON_HALIGN_CENTER, SAFFRON_VALIGN_CENTER, 5, 5, 0, width, height); return button; }