Mercurial > pidgin
comparison console/libgnt/gntbox.c @ 13878:0d0ab1e39d0a
[gaim-migrate @ 16355]
Change the behaviour of the widgets about how they update themselves.
This makes things a little better, and hopefully easier to build more
stuff on top of this.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Tue, 27 Jun 2006 02:33:55 +0000 |
parents | 5642f4658b59 |
children | 5c750626eaa5 |
comparison
equal
deleted
inserted
replaced
13877:765bbdf29d04 | 13878:0d0ab1e39d0a |
---|---|
10 | 10 |
11 static void | 11 static void |
12 gnt_box_draw(GntWidget *widget) | 12 gnt_box_draw(GntWidget *widget) |
13 { | 13 { |
14 GntBox *box = GNT_BOX(widget); | 14 GntBox *box = GNT_BOX(widget); |
15 GList *iter; | 15 |
16 | 16 g_list_foreach(box->list, (GFunc)gnt_widget_draw, NULL); |
17 for (iter = box->list; iter; iter = iter->next) | 17 |
18 { | 18 gnt_box_sync_children(box); |
19 GntWidget *w = GNT_WIDGET(iter->data); | |
20 gnt_widget_draw(w); | |
21 overwrite(w->window, widget->window); | |
22 } | |
23 | 19 |
24 if (box->title) | 20 if (box->title) |
25 { | 21 { |
26 gchar *title = g_strdup(box->title); | 22 gchar *title = g_strdup(box->title); |
27 int pos = g_utf8_strlen(title, -1); | 23 int pos = g_utf8_strlen(title, -1); |
38 } | 34 } |
39 wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_TITLE)); | 35 wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_TITLE)); |
40 mvwprintw(widget->window, 0, pos, title); | 36 mvwprintw(widget->window, 0, pos, title); |
41 g_free(title); | 37 g_free(title); |
42 } | 38 } |
43 wrefresh(widget->window); | |
44 | |
45 gnt_screen_occupy(widget); | |
46 | 39 |
47 DEBUG; | 40 DEBUG; |
48 } | 41 } |
49 | 42 |
50 static void | 43 static void |
374 GNT_WIDGET_UNSET_FLAGS(widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); | 367 GNT_WIDGET_UNSET_FLAGS(widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); |
375 else | 368 else |
376 GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); | 369 GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); |
377 } | 370 } |
378 | 371 |
372 void gnt_box_sync_children(GntBox *box) | |
373 { | |
374 GList *iter; | |
375 GntWidget *widget = GNT_WIDGET(box); | |
376 | |
377 for (iter = box->list; iter; iter = iter->next) | |
378 { | |
379 GntWidget *w = GNT_WIDGET(iter->data); | |
380 copywin(w->window, widget->window, 0, 0, w->priv.y - widget->priv.y, w->priv.x - widget->priv.x, | |
381 w->priv.height, w->priv.width, FALSE); | |
382 } | |
383 } | |
384 |