# HG changeset patch # User Sadrul Habib Chowdhury # Date 1151024250 0 # Node ID a4c30c1d9de82417f6e06c701dbbf9b77a1eb53d # Parent bbf0470cb348c968db2476d5f2864621f0e889a4 [gaim-migrate @ 16313] Unnecessary variables are bad, mmkay. committer: Tailor Script diff -r bbf0470cb348 -r a4c30c1d9de8 console/libgnt/gntbox.c --- a/console/libgnt/gntbox.c Fri Jun 23 00:45:45 2006 +0000 +++ b/console/libgnt/gntbox.c Fri Jun 23 00:57:30 2006 +0000 @@ -50,7 +50,6 @@ GntBox *box = GNT_BOX(widget); int w, h, curx, cury, max; gboolean has_border = FALSE; - int x, y; w = h = 0; max = -1; diff -r bbf0470cb348 -r a4c30c1d9de8 console/libgnt/gnttree.c --- a/console/libgnt/gnttree.c Fri Jun 23 00:45:45 2006 +0000 +++ b/console/libgnt/gnttree.c Fri Jun 23 00:57:30 2006 +0000 @@ -34,7 +34,7 @@ else pos = 1; - wbkgd(tree->scroll, COLOR_PAIR(GNT_COLOR_NORMAL)); + wbkgd(widget->window, COLOR_PAIR(GNT_COLOR_NORMAL)); for (start = tree->top, iter = g_list_nth(tree->list, tree->top); iter && start < tree->bottom; start++, iter = iter->next) @@ -57,18 +57,18 @@ if (start == tree->current) { - wbkgdset(tree->scroll, '\0' | COLOR_PAIR(GNT_COLOR_HIGHLIGHT)); - mvwprintw(tree->scroll, start - tree->top + pos, pos, str); - wbkgdset(tree->scroll, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); + wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_HIGHLIGHT)); + mvwprintw(widget->window, start - tree->top + pos, pos, str); + wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); } else - mvwprintw(tree->scroll, start - tree->top + pos, pos, str); + mvwprintw(widget->window, start - tree->top + pos, pos, str); } while (start < tree->bottom) { - wmove(tree->scroll, start - tree->top + pos, pos); - wclrtoeol(tree->scroll); + wmove(widget->window, start - tree->top + pos, pos); + wclrtoeol(widget->window); start++; } @@ -80,21 +80,12 @@ { GntTree *tree = GNT_TREE(widget); - /* For the Tree (or anything that scrolls), we will create a 'hidden' window - * of 'large enough' size. We never wrefresh that hidden-window, instead we - * just copy stuff from it into the visible window */ + scrollok(widget->window, TRUE); + wsetscrreg(widget->window, 0, widget->priv.height - 1); - if (tree->scroll == NULL) - { - tree->scroll = widget->window; /* newwin(SCROLL_HEIGHT, widget->priv.width, 0, 0); */ - scrollok(tree->scroll, TRUE); - /*wsetscrreg(tree->scroll, 0, SCROLL_HEIGHT - 1);*/ - wsetscrreg(tree->scroll, 0, widget->priv.height - 1); - - tree->top = 0; - tree->bottom = widget->priv.height - - (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_NO_BORDER) ? 0 : 2); - } + tree->top = 0; + tree->bottom = widget->priv.height - + (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_NO_BORDER) ? 0 : 2); redraw_tree(tree); diff -r bbf0470cb348 -r a4c30c1d9de8 console/libgnt/gnttree.h --- a/console/libgnt/gnttree.h Fri Jun 23 00:45:45 2006 +0000 +++ b/console/libgnt/gnttree.h Fri Jun 23 00:57:30 2006 +0000 @@ -27,8 +27,6 @@ { GntWidget parent; - WINDOW *scroll; - int current; /* current selection */ int top; /* The index in 'list' of the topmost visible item */