From 072f42236fb0d2509608a3ad345df2c5cf71f8dd Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 04 Aug 2021 19:58:00 -0400 Subject: tk: Reduce initialization boilerplate code --- (limited to 'src/tk/grid.c') diff --git a/src/tk/grid.c b/src/tk/grid.c index 4f09928..5994929 100644 --- a/src/tk/grid.c +++ b/src/tk/grid.c @@ -142,12 +142,7 @@ mftk_grid_new(int rows, int cols, int row_spacing, int col_spacing, ...) int r; int c; - if ((w = mftk_widget_new(sizeof(*g))) == NULL) return NULL; - g = (struct mftk_grid *) w; - w->layout = &_mftk_grid_layout; - w->event = &_mftk_grid_event; - w->render = &_mftk_grid_render; - w->destroy = &_mftk_grid_destroy; + mftk_widget_init(w, g, grid); g->children = calloc(rows * cols, sizeof(*g->children)); if (g->children == NULL) { -- cgit v0.9.1