#include <ctype.h>
#include <slang/slang.h>
#include <stdlib.h>
+#include <string.h>
#include "newt.h"
#include "newt_pr.h"
en->buf = malloc(en->bufAlloced);
*en->resultPtr = en->buf;
}
+ memset(en->buf, 0, en->bufAlloced); /* clear the buffer */
strcpy(en->buf, value);
en->bufUsed = strlen(value);
en->firstChar = 0;
SLsmg_write_nstring(chptr, co->width);
}
- newtGotorc(co->top, co->left + (en->cursorPosition - en->firstChar));
+ if (en->flags & NEWT_ENTRY_HIDDEN)
+ newtGotorc(co->top, co->left);
+ else
+ newtGotorc(co->top, co->left + (en->cursorPosition - en->firstChar));
}
static void entryDestroy(newtComponent co) {
switch (ev.event) {
case EV_FOCUS:
/*SLtt_set_cursor_visibility(0);*/
- newtGotorc(co->top, co->left +
- (en->cursorPosition - en->firstChar));
+ if (en->flags & NEWT_ENTRY_HIDDEN)
+ newtGotorc(co->top, co->left);
+ else
+ newtGotorc(co->top, co->left +
+ (en->cursorPosition - en->firstChar));
er.result = ER_SWALLOWED;
break;