summaryrefslogtreecommitdiff
path: root/lib/libforms
diff options
context:
space:
mode:
authorPaul Richards <paul@FreeBSD.org>1995-01-11 06:08:45 +0000
committerPaul Richards <paul@FreeBSD.org>1995-01-11 06:08:45 +0000
commitf4ae9090f4cb7308d76d08fd2d30d9b2859bff04 (patch)
treef3bb96c196d1e82f52b515abd2a2e36b790fe659 /lib/libforms
parent49b95be03e016ae4685b00d1e31dd695b83562b7 (diff)
Notes
Diffstat (limited to 'lib/libforms')
-rw-r--r--lib/libforms/examples/test.c2
-rw-r--r--lib/libforms/forms.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/libforms/examples/test.c b/lib/libforms/examples/test.c
index 8725c2b17c19..d58735491b81 100644
--- a/lib/libforms/examples/test.c
+++ b/lib/libforms/examples/test.c
@@ -35,7 +35,7 @@ main()
struct text_field field4 = {string4};
struct input_field field5 = {1,"A place filler",0};
struct text_field field6 = {string6};
- struct menu_field field7 = {4, 0, options7};
+ struct menu_field field7 = {sizeof &options7, 0, options7};
struct action_field field8 = {"EXIT",&exit_form};
struct action_field field9 = {"CANCEL",&cancel_form};
diff --git a/lib/libforms/forms.c b/lib/libforms/forms.c
index c865b34d94c2..72dd90ff048c 100644
--- a/lib/libforms/forms.c
+++ b/lib/libforms/forms.c
@@ -101,6 +101,8 @@ int
update_form(struct form *form)
{
+ show_form(form);
+
switch (form->field[form->current_field].type) {
case F_MENU:
field_menu(form);
@@ -115,8 +117,6 @@ update_form(struct form *form)
default:
}
- show_form(form);
-
return (done);
}
@@ -379,11 +379,11 @@ field_input(struct form *form)
if (field->field.input->lbl_flag) {
field->field.input->lbl_flag = 0;
}
- if (ch == F_CHOME) {
+ if ((ch == F_CHOME) || (ch == '')) {
disp_off = 0;
cursor = 0;
abspos = 0;
- } else if (ch == F_CEND) {
+ } else if ((ch == F_CEND) || (ch == '')) {
disp_off = DISPOFF;
abspos = len;
cursor = CURSPOS;
@@ -396,7 +396,7 @@ field_input(struct form *form)
len - abspos);
--len;
}
- } else if ((ch == F_CLEFT) || (ch == F_CBS)) {
+ } else if ((ch == F_CLEFT) || (ch == F_CBS) || (ch == '')) {
if (!abspos)
beep();
else {
@@ -413,7 +413,7 @@ field_input(struct form *form)
++cursor;
}
}
- } else if (ch == F_CRIGHT) {
+ } else if ((ch == F_CRIGHT) || (ch == '')) {
if (abspos == len)
beep();
else {