comparison console/libgnt/gntmain.c @ 13964:0a0d2a1fd2bc

[gaim-migrate @ 16520] Add multi-column support for GntTree. Use it for email-notifications. Restore colors before exiting. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 19 Jul 2006 07:12:59 +0000
parents 421259b9e06d
children b7a99d54a5a9
comparison
equal deleted inserted replaced
13963:f7cfaee79982 13964:0a0d2a1fd2bc
256 256
257 for (iter = g_list_first(focus_list); iter; iter = iter->next) 257 for (iter = g_list_first(focus_list); iter; iter = iter->next)
258 { 258 {
259 GntBox *box = GNT_BOX(iter->data); 259 GntBox *box = GNT_BOX(iter->data);
260 260
261 gnt_tree_add_row_after(GNT_TREE(tree), box, box->title, NULL, NULL); 261 gnt_tree_add_row_after(GNT_TREE(tree), box,
262 gnt_tree_create_row(GNT_TREE(tree), box->title), NULL, NULL);
262 update_window_in_list(GNT_WIDGET(box)); 263 update_window_in_list(GNT_WIDGET(box));
263 } 264 }
264 265
265 gnt_tree_set_selected(GNT_TREE(tree), focus_list->data); 266 gnt_tree_set_selected(GNT_TREE(tree), focus_list->data);
266 gnt_box_add_widget(GNT_BOX(win), tree); 267 gnt_box_add_widget(GNT_BOX(win), tree);
267 268
268 gnt_widget_set_size(tree, getmaxx(stdscr) / 3, getmaxy(stdscr) / 2); 269 gnt_tree_set_col_width(GNT_TREE(tree), 0, getmaxx(stdscr) / 3);
270 gnt_widget_set_size(tree, 0, getmaxy(stdscr) / 2);
269 gnt_widget_set_position(win, getmaxx(stdscr) / 3, getmaxy(stdscr) / 4); 271 gnt_widget_set_position(win, getmaxx(stdscr) / 3, getmaxy(stdscr) / 4);
270 272
271 lock_focus_list = 1; 273 lock_focus_list = 1;
272 gnt_widget_show(win); 274 gnt_widget_show(win);
273 lock_focus_list = 0; 275 lock_focus_list = 0;
537 ascii_only = FALSE; 539 ascii_only = FALSE;
538 else 540 else
539 ascii_only = TRUE; 541 ascii_only = TRUE;
540 542
541 initscr(); 543 initscr();
542 start_color();
543 gnt_init_colors(); 544 gnt_init_colors();
544 545
545 X_MIN = 0; 546 X_MIN = 0;
546 Y_MIN = 0; 547 Y_MIN = 0;
547 X_MAX = getmaxx(stdscr); 548 X_MAX = getmaxx(stdscr);
600 { 601 {
601 if ((GNT_IS_BOX(widget) && GNT_BOX(widget)->title) && window_list.window != widget 602 if ((GNT_IS_BOX(widget) && GNT_BOX(widget)->title) && window_list.window != widget
602 && GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_CAN_TAKE_FOCUS)) 603 && GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_CAN_TAKE_FOCUS))
603 { 604 {
604 gnt_tree_add_row_after(GNT_TREE(window_list.tree), widget, 605 gnt_tree_add_row_after(GNT_TREE(window_list.tree), widget,
605 GNT_BOX(widget)->title, NULL, NULL); 606 gnt_tree_create_row(GNT_TREE(window_list.tree), GNT_BOX(widget)->title),
607 NULL, NULL);
606 update_window_in_list(widget); 608 update_window_in_list(widget);
607 } 609 }
608 } 610 }
609 611
610 update_panels(); 612 update_panels();
690 draw_taskbar(); 692 draw_taskbar();
691 } 693 }
692 694
693 void gnt_quit() 695 void gnt_quit()
694 { 696 {
697 gnt_uninit_colors();
695 endwin(); 698 endwin();
696 } 699 }
697 700
698 gboolean gnt_ascii_only() 701 gboolean gnt_ascii_only()
699 { 702 {