#include "wtimpl.h"
-static void draw_win(wt_widget *w);
+static void draw_win(wt_widget *w, struct wt_graphics *gfx);
+static void use_theme(wt_widget *w, struct wt_theme *theme);
wt_widget *wt_window(wt_widget *par, const char *title, int style, int x, int y, int xsz, int ysz)
{
wt_resize(w, xsz, ysz);
/* TODO: style */
- w->draw = draw_win;
+ use_theme(w, wt->theme);
return w;
}
-static void draw_win(wt_widget *w)
+static void draw_win(wt_widget *w, struct wt_graphics *gfx)
{
wt_gfx_color(COL_BG);
wt_gfx_fillrect(&w->rect);
}
+
+static void use_theme(wt_widget *w, struct wt_theme *theme)
+{
+ w->draw = theme && theme->draw_window ? theme->draw_window : draw_win;
+}