Re: the too wide modules window
In reference to a message from Sean 'Shaleh' Perry, dated Dec 13:
> while doing installs, I noted that the net modules window was too wide to see
> the actual module names. This is due to overly long text in some descriptions.
> We need to seek a better method, or teach all of our users that a tulip card
> is actually the lip card (-:
incidentally, it appears that Enrique was not aware of an NMU i made that
fixed some of the word wrapping bugs in whiptail/newt. I had uploaded 0.50-4.1
that closed three bugs (36587, 43270 and 47855). These bugs appear to be
there again in 0.50-5 and perhaps should be reopened.
The patch is attached here. I'm pretty sure I've sent this in before, but
anyway...
randolph
--
Debian Developer <tausq@debian.org>
http://www.TauSq.org/
diff -uNr newt-0.50.orig/dialogboxes.c newt-0.50/dialogboxes.c
--- newt-0.50.orig/dialogboxes.c Sat Oct 23 21:29:20 1999
+++ newt-0.50/dialogboxes.c Sat Oct 23 21:32:42 1999
@@ -364,6 +364,18 @@
newtComponent form, yes, tb, answer;
newtComponent no = NULL;
int tFlag = (flags & FLAG_SCROLL_TEXT) ? NEWT_FLAG_SCROLL : 0;
+ char * buf, * src, * dst;
+
+ dst = buf = alloca(strlen(text) + 1);
+ src = text;
+ while (*src) {
+ if (*src == '\\' && *(src + 1) == 'n') {
+ src += 2;
+ *dst++ = '\n';
+ } else
+ *dst++ = *src++;
+ }
+ *dst++ = '\0';
form = newtForm(NULL, NULL, 0);
@@ -375,7 +387,7 @@
tb = newtTextbox(1, 1, width - 2, height - 2, NEWT_FLAG_WRAP | tFlag);
}
- newtTextboxSetText(tb, text);
+ newtTextboxSetText(tb, buf);
newtFormAddComponent(form, tb);
diff -uNr newt-0.50.orig/entry.c newt-0.50/entry.c
--- newt-0.50.orig/entry.c Sun Aug 1 21:25:14 1999
+++ newt-0.50/entry.c Sat Oct 23 21:34:06 1999
@@ -285,6 +285,12 @@
}
break;
+ case '\025': /* ^U */
+ en->cursorPosition = 0;
+ *(en->buf) = 0;
+ en->bufUsed = 0;
+ break;
+
case NEWT_KEY_BKSPC:
if (en->cursorPosition) {
/* if this isn't true, there's nothing to erase */
diff -uNr newt-0.50.orig/form.c newt-0.50/form.c
--- newt-0.50.orig/form.c Sat Oct 23 21:29:20 1999
+++ newt-0.50/form.c Sat Oct 23 21:37:10 1999
@@ -67,7 +67,7 @@
unsigned char buttons, modifiers; /* try to be a multiple of 4 */
unsigned short vc;
short dx, dy, x, y;
- short wdx, wdy; // For wheels..
+ short wdx, wdy; /* For wheels.. */
enum Gpm_Etype type;
int clicks;
enum Gpm_Margin margin;
Reply to: