return w->par;
}
+int tui_isdirty(struct tui_widget *w)
+{
+ return w->dirty;
+}
+
void tui_draw(struct tui_widget *w)
{
struct tui_widget *iter;
if(w->cbfunc[TUI_DRAW]) {
w->cbfunc[TUI_DRAW](w, 0);
}
+ w->dirty = 0;
iter = w->child;
while(iter) {
w->cbcls[type] = cls;
}
+void tui_call_callback(struct tui_widget *w, int type)
+{
+ if(w->cbfunc[type]) {
+ w->cbfunc[type](w, w->cbcls[type]);
+ }
+}
+
+void tui_focus(struct tui_widget *w, int focus)
+{
+ focus = focus ? 1 : 0;
+ if(w->focus == focus) {
+ return;
+ }
+ w->focus = focus;
+ w->dirty = 1;
+ tui_call_callback(w, TUI_ONFOCUS);
+}
+
int tui_set_title(struct tui_widget *w, const char *s)
{
free(w->title);