]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
put the cursor in the proper place after drawing
authorewt <ewt>
Thu, 13 Jan 2000 23:41:18 +0000 (23:41 +0000)
committerewt <ewt>
Thu, 13 Jan 2000 23:41:18 +0000 (23:41 +0000)
checkboxtree.c

index 7b4e4dab8205b3720c346795c8fd1c5b3ef342a7..c52483c726cd7e9de9067410e2f90f8cb3ce9559 100644 (file)
@@ -398,8 +398,9 @@ int ctSetItem(newtComponent co, struct items *item, enum newtFlagsSense sense)
 static void ctDraw(newtComponent co) {
     struct CheckboxTree * ct = co->data;
     struct items ** item; 
-    int i, curr, j;
+    int i, j;
     char * spaces;
+    int currRow;
 
     if (!co->isMapped) return ;
 
@@ -415,6 +416,7 @@ static void ctDraw(newtComponent co) {
        newtGotorc(co->top + i, co->left);
        if (*item == *ct->currItem) {
            SLsmg_set_color(NEWT_COLORSET_ACTLISTBOX);
+           currRow = co->top + i;
        } else
            SLsmg_set_color(NEWT_COLORSET_LISTBOX);
 
@@ -462,7 +464,7 @@ static void ctDraw(newtComponent co) {
        ct->sb->ops->draw(ct->sb);
     }
 
-    newtGotorc(co->top + curr, co->left + 1);
+    newtGotorc(currRow, co->left + 1);
 }
 
 static void ctDestroy(newtComponent co) {