patch for lxdialog

Alexander V. Lukyanov (lav@yars.free.net)
Tue, 4 Feb 1997 02:00:11 +0300 (MSK)


Bug description: in menubox.c print_item was called when the window
was scrollable. When this happened for the last line in the window,
the window scrolled one more line than was needed.

Repeat: In selection of network device, press page-down from the first
line in the list.

patch (for 2.1.25, probably for much earlier ones):
--- menubox.c.orig Tue Feb 4 01:49:41 1997
+++ menubox.c Tue Feb 4 01:51:38 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