mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
Tweak a few things just to show how form traversal might work fully.
Fix some spelling errors in the example.c file and make error handling a little more explanatory.
This commit is contained in:
parent
4fe2ad2c59
commit
e36fea798c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7437
@ -52,7 +52,7 @@ main()
|
||||
form = form_start("example");
|
||||
|
||||
if (!form) {
|
||||
err(-1, "No form returned");
|
||||
err(-1, "No form `example' in example.frm returned");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ main()
|
||||
|
||||
tuple = form_get_tuple(global_bindings, "example", FT_FORM);
|
||||
if (!tuple)
|
||||
err(0, "No such form");
|
||||
err(0, "No such form: example");
|
||||
else
|
||||
form = (struct Form *)tuple->addr;
|
||||
|
||||
@ -82,7 +82,7 @@ main()
|
||||
wrefresh(form->window);
|
||||
|
||||
if (form->status == FS_EXIT) {
|
||||
printf("You're entries were:\n\n");
|
||||
printf("Your entries were:\n\n");
|
||||
tuple = form_get_tuple(form->bindings, "input1", FT_FIELD_INST);
|
||||
printf("Input 1 = %s\n", ((struct Field *)tuple->addr)->field.input->input);
|
||||
tuple = form_get_tuple(form->bindings, "input2", FT_FIELD_INST);
|
||||
|
@ -46,9 +46,9 @@ Form example at 0,0 {
|
||||
field4 at 11, 2
|
||||
field6 at 15, 2
|
||||
|
||||
input1 {field3} at 7,45, next=input2
|
||||
input2 {field5} at 11,45, next=menu1
|
||||
menu1 {field7} at 15,45, next=quit
|
||||
quit {field8} at 20,20, up = menu1, right = cancel
|
||||
cancel {field9} at 20,43, next=input1
|
||||
input1 {field3} at 7,45, next=input2,down=input2,up=quit,right=input2
|
||||
input2 {field5} at 11,45, next=menu1,down=menu1,up=input1,right=menu1
|
||||
menu1 {field7} at 15,45, next=quit,down=quit,up=input2,right=quit
|
||||
quit {field8} at 20,20, next=cancel,down=input1,up=menu1,right=cancel
|
||||
cancel {field9} at 20,43, next=input1,down=input1,up=menu1,right=input1
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user