patch-2.1.89 linux/scripts/lxdialog/checklist.c

Next file: linux/CREDITS
Previous file: linux/net/x25/af_x25.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.88/linux/scripts/lxdialog/checklist.c linux/scripts/lxdialog/checklist.c
@@ -188,9 +188,16 @@
     check_x = (list_width - check_x) / 2;
     item_x = check_x + 4;
 
+    if (choice >= list_height) {
+	scroll = choice - list_height + 1;
+	choice -= scroll;
+    }
+
     /* Print the list */
-    for (i = 0; i < max_choice; i++)
-	print_item (list, items[i * 3 + 1], status[i], i, i == choice);
+    for (i = 0; i < max_choice; i++) {
+	print_item (list, items[(scroll+i) * 3 + 1],
+		    status[i+scroll], i, i == choice);
+    }
 
     wnoutrefresh (list);
 


FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov