initial commit
[windtk] / src / window.c
1 #include "wtimpl.h"
2
3 static void draw_win(wt_widget *w);
4
5 wt_widget *wt_window(wt_widget *par, const char *title, int style, int x, int y, int xsz, int ysz)
6 {
7         wt_widget *w;
8
9         if(!(w = wt_alloc_widget(par))) {
10                 return 0;
11         }
12         w->type = WT_TYPE_WINDOW;
13         wt_set_text(w, title);
14         wt_move(w, x, y);
15         wt_resize(w, xsz, ysz);
16         /* TODO: style */
17
18         w->draw = draw_win;
19         return w;
20 }
21
22 static void draw_win(wt_widget *w)
23 {
24         wt_gfx_color(COL_BG);
25         wt_gfx_fillrect(&w->rect);
26 }