lxdialog patch

Alexander V. Lukyanov (lav@video.yars.free.net)
Sun, 20 Jul 1997 00:55:29 +0400 (MSD)


print_item can occasionally scroll the window one extra time,
this causes a mess on screen when one presses PgUp or PgDown
in a long list of items. This applies to 2.0 and 2.1 kernels.
It is very minor problem, but the visible effect is not pleasing.
The following patch should cure the problem.

Alexander.

--- menubox.c.0 Sat Apr 27 14:18:18 1996
+++ menubox.c Tue Feb 4 01:43:08 1997
@@ -261,26 +261,26 @@
choice = MIN(choice+1, max_choice-1);

} else if (key == KEY_PPAGE) {
- scrollok (menu, TRUE);
for (i=0; (i < max_choice) && (scroll > 0); i++) {
+ scrollok (menu, TRUE);
wscrl (menu, -1);
+ scrollok (menu, FALSE);
scroll--;
print_item (menu, items[scroll * 2 + 1], 0, FALSE,
(items[scroll*2][0] != ':'));
}
- scrollok (menu, FALSE);
choice = 0;

} else if (key == KEY_NPAGE) {
- scrollok (menu, TRUE);
for (i=0; (i < max_choice) && (scroll+max_choice < item_no); i++) {
+ scrollok (menu, TRUE);
scroll(menu);
+ scrollok (menu, FALSE);
scroll++;
print_item (menu, items[(scroll+max_choice-1)*2+1],
max_choice-1, FALSE,
(items[(scroll+max_choice-1)*2][0] != ':'));
}
- scrollok (menu, FALSE);
choice = 0;

} else