aboutsummaryrefslogtreecommitdiff
path: root/examples_library/form.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples_library/form.c')
-rw-r--r--examples_library/form.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/examples_library/form.c b/examples_library/form.c
index 0256975f2023..56d8a8052a72 100644
--- a/examples_library/form.c
+++ b/examples_library/form.c
@@ -9,6 +9,7 @@
*/
#include <bsddialog.h>
+#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -21,21 +22,22 @@ int main()
int i, output;
struct bsddialog_conf conf;
struct bsddialog_formitem items[3] = {
- {"Input:", 1, 1, "value", 1, 11, 30, 50, NULL, 0, "desc 1"},
- {"Input:", 2, 1, "read only", 2, 11, 30, 50, NULL, RO, "desc 2"},
- {"Password:", 3, 1, "", 3, 11, 30, 50, NULL, H, "desc 3"}
+ {"Input:", 0, 0, "value", 0, 10, 30, 50, NULL, 0, "desc 1"},
+ {"Input:", 1, 0, "read only", 1, 10, 30, 50, NULL, RO, "desc 2"},
+ {"Password:", 2, 0, "", 2, 10, 30, 50, NULL, H, "desc 3"}
};
+ /* Optional, unless for unicode/multicolum charachters */
+ setlocale(LC_ALL, "");
+
if (bsddialog_init() == BSDDIALOG_ERROR) {
printf("Error: %s\n", bsddialog_geterror());
return (1);
}
-
bsddialog_initconf(&conf);
conf.title = "form";
conf.form.securech = '*';
output = bsddialog_form(&conf, "Example", 10, 50, 3, 3, items);
-
bsddialog_end();
if (output == BSDDIALOG_ERROR) {