int wt_init(int w, int h, struct wt_graphics *gfx)
{
+ wt->root = 0;
if(!(wt->root = wt_alloc_widget(0))) {
return -1;
}
{
}
+void wt_draw_tree(wt_widget *tree)
+{
+ int i;
+
+ if(tree->draw) {
+ tree->draw(tree);
+ }
+
+ for(i=0; i<tree->num_child; i++) {
+ wt_draw_tree(tree->child[i]);
+ }
+}
+
+void wt_draw(void)
+{
+ wt_draw_tree(wt->root);
+}
+
void wt_gfx_color(int cidx)
{
wt->gfx.color(wt->colors[cidx]);