lkml.org 
[lkml]   [1998]   [Jun]   [13]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateSat, 13 Jun 1998 18:35:43 +0200 (MEST)
FromClifford Wolf <>
Subjectbug in lxdialog (and the bugfix)
Hi,

I had allready problems with the Page-Down key in menuconfig in the first
2.0.x versions - but till now I had never the time to have a look at it.
The symptom was that I got a broken menu if I pressed the Page-Down key in
a configuration menu. I attached a little patch that fixes this bug.

The reason was that lxdialog outputs the lines at the bottom of the
window while scrolling is turned on - so ncurses ouputs an extra newline.
The patch moves the calls to scrollok() to other locations so that
scrolling is now disabled when the item is printed out.

BTW: The calls to scrollok() are *not* necessary at all! They are only
needed for the automatic scrolling - Scrolling by calling the functions
scroll() and wscrl() work without them to. So if I'm not compleatly
wrong we could remove most of the calles to the scrollok() function.

I don't have the source of the original dialog program by Savio Lam.
So I can't figure out if this bug exist in the original version too
or only in the hacked one. William: I guess that you have the original
source - could you have a look at it and forward this mail to Savio if
needed?

 - clifford

PS: The attached patch is for 2.1.105 - but i don't think that they are
any changes to this file made at all ...

--    --    --    --    --    --    --    --    --    --    --    --    --
Clifford Wolf
magnet - Internet at Work                            IRC: efnet / clifford
Director of System Development                     http://www.clifford.at/
e-mail: c.wolf@magnet.at                            email: god@clifford.at
--- linux/scripts/lxdialog/menubox.c.orig	Sat Jun 13 16:41:49 1998
+++ linux/scripts/lxdialog/menubox.c	Sat Jun 13 17:23:27 1998
@@ -272,15 +272,15 @@
                 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
\
 
 \ /
  Last update: 2005-03-22 12:43    [from the cache]
©2003-2008