diff 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
line wrap: on
line diff
--- a/console/libgnt/gntmain.c	Tue Jul 18 07:18:05 2006 +0000
+++ b/console/libgnt/gntmain.c	Wed Jul 19 07:12:59 2006 +0000
@@ -258,14 +258,16 @@
 	{
 		GntBox *box = GNT_BOX(iter->data);
 
-		gnt_tree_add_row_after(GNT_TREE(tree), box, box->title, NULL, NULL);
+		gnt_tree_add_row_after(GNT_TREE(tree), box,
+				gnt_tree_create_row(GNT_TREE(tree), box->title), NULL, NULL);
 		update_window_in_list(GNT_WIDGET(box));
 	}
 
 	gnt_tree_set_selected(GNT_TREE(tree), focus_list->data);
 	gnt_box_add_widget(GNT_BOX(win), tree);
 
-	gnt_widget_set_size(tree, getmaxx(stdscr) / 3, getmaxy(stdscr) / 2);
+	gnt_tree_set_col_width(GNT_TREE(tree), 0, getmaxx(stdscr) / 3);
+	gnt_widget_set_size(tree, 0, getmaxy(stdscr) / 2);
 	gnt_widget_set_position(win, getmaxx(stdscr) / 3, getmaxy(stdscr) / 4);
 
 	lock_focus_list = 1;
@@ -539,7 +541,6 @@
 		ascii_only = TRUE;
 
 	initscr();
-	start_color();
 	gnt_init_colors();
 
 	X_MIN = 0;
@@ -602,7 +603,8 @@
 				&& GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_CAN_TAKE_FOCUS))
 		{
 			gnt_tree_add_row_after(GNT_TREE(window_list.tree), widget,
-					GNT_BOX(widget)->title, NULL, NULL);
+					gnt_tree_create_row(GNT_TREE(window_list.tree), GNT_BOX(widget)->title),
+					NULL, NULL);
 			update_window_in_list(widget);
 		}
 	}
@@ -692,6 +694,7 @@
 
 void gnt_quit()
 {
+	gnt_uninit_colors();
 	endwin();
 }