comparison console/libgnt/gntbox.c @ 13869:5642f4658b59

[gaim-migrate @ 16335] A bunch of stuff that doesn't really do much. I am trying to get the "expose" thingy going where a widget will redraw some of its parts when some other widget covering it is destroyed. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 25 Jun 2006 03:15:41 +0000
parents cf6f32628f8f
children 0d0ab1e39d0a
comparison
equal deleted inserted replaced
13868:b355f7ed1814 13869:5642f4658b59
14 GntBox *box = GNT_BOX(widget); 14 GntBox *box = GNT_BOX(widget);
15 GList *iter; 15 GList *iter;
16 16
17 for (iter = box->list; iter; iter = iter->next) 17 for (iter = box->list; iter; iter = iter->next)
18 { 18 {
19 gnt_widget_draw(GNT_WIDGET(iter->data)); 19 GntWidget *w = GNT_WIDGET(iter->data);
20 gnt_widget_draw(w);
21 overwrite(w->window, widget->window);
20 } 22 }
21 23
22 if (box->title) 24 if (box->title)
23 { 25 {
24 gchar *title = g_strdup(box->title); 26 gchar *title = g_strdup(box->title);
37 wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_TITLE)); 39 wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_TITLE));
38 mvwprintw(widget->window, 0, pos, title); 40 mvwprintw(widget->window, 0, pos, title);
39 g_free(title); 41 g_free(title);
40 } 42 }
41 wrefresh(widget->window); 43 wrefresh(widget->window);
44
45 gnt_screen_occupy(widget);
42 46
43 DEBUG; 47 DEBUG;
44 } 48 }
45 49
46 static void 50 static void
261 for (iter = box->list; iter; iter = iter->next) 265 for (iter = box->list; iter; iter = iter->next)
262 { 266 {
263 gnt_widget_destroy(iter->data); 267 gnt_widget_destroy(iter->data);
264 } 268 }
265 269
270 gnt_screen_release(w);
271
266 g_list_free(box->list); 272 g_list_free(box->list);
273 }
274
275 static void
276 gnt_box_expose(GntWidget *widget, int x, int y, int width, int height)
277 {
278 WINDOW *win = newwin(height, width, widget->priv.y + y, widget->priv.x + x);
279 copywin(widget->window, win, y, x, 0, 0, height - 1, width - 1, FALSE);
280 wrefresh(win);
281 delwin(win);
267 } 282 }
268 283
269 static void 284 static void
270 gnt_box_class_init(GntBoxClass *klass) 285 gnt_box_class_init(GntBoxClass *klass)
271 { 286 {
272 GObjectClass *obj_class = G_OBJECT_CLASS(klass); 287 GObjectClass *obj_class = G_OBJECT_CLASS(klass);
273 288
274 parent_class = GNT_WIDGET_CLASS(klass); 289 parent_class = GNT_WIDGET_CLASS(klass);
275 parent_class->destroy = gnt_box_destroy; 290 parent_class->destroy = gnt_box_destroy;
276 parent_class->draw = gnt_box_draw; 291 parent_class->draw = gnt_box_draw;
292 parent_class->expose = gnt_box_expose;
277 parent_class->map = gnt_box_map; 293 parent_class->map = gnt_box_map;
278 parent_class->size_request = gnt_box_size_request; 294 parent_class->size_request = gnt_box_size_request;
279 parent_class->set_position = gnt_box_set_position; 295 parent_class->set_position = gnt_box_set_position;
280 parent_class->key_pressed = gnt_box_key_pressed; 296 parent_class->key_pressed = gnt_box_key_pressed;
281 parent_class->lost_focus = gnt_box_lost_focus; 297 parent_class->lost_focus = gnt_box_lost_focus;