summaryrefslogtreecommitdiffstats
path: root/src/tk/button.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tk/button.c')
-rw-r--r--src/tk/button.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/tk/button.c b/src/tk/button.c
index c7d0c5f..0db91a9 100644
--- a/src/tk/button.c
+++ b/src/tk/button.c
@@ -103,12 +103,7 @@ mftk_button_new(TTF_Font *font, const char *text, SDL_Color *text_color,
struct mftk_widget *w;
struct mftk_button *b;
- if ((w = mftk_widget_new(sizeof(*b))) == NULL) return NULL;
- b = (struct mftk_button *) w;
- w->layout = &_mftk_button_layout;
- w->event = &_mftk_button_event;
- w->render = &_mftk_button_render;
- w->destroy = &_mftk_button_destroy;
+ mftk_widget_init(w, b, button);
b->label = mftk_label_new(font, text, text_color, renderer);
if (b->label == NULL) {