diff options
author | Alfonso Siciliano <alfsiciliano@gmail.com> | 2022-01-28 08:14:55 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2022-01-28 08:14:55 +0000 |
commit | 02db4a1234b3bd9cf153e567827fd387cf91bfb2 (patch) | |
tree | 6a8d148a11a4a9d58ba1adb078d72e491339652b /examples_library/msgbox.c | |
parent | 77a55d2c3b4dd48a9a608736a9ba7ebce700bae1 (diff) |
Diffstat (limited to 'examples_library/msgbox.c')
-rw-r--r-- | examples_library/msgbox.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/examples_library/msgbox.c b/examples_library/msgbox.c index 487266745c65..32696894aa85 100644 --- a/examples_library/msgbox.c +++ b/examples_library/msgbox.c @@ -15,28 +15,28 @@ int main() { - int input; + int output; struct bsddialog_conf conf; - /* Configuration */ - bsddialog_initconf(&conf); - conf.title = "msgbox"; - - /* Run BSDDialog */ if (bsddialog_init() == BSDDIALOG_ERROR) { printf("Error: %s\n", bsddialog_geterror()); - return -1; + return (1); } - input = bsddialog_msgbox(&conf, "Example", 7, 20); + + bsddialog_initconf(&conf); + conf.title = "msgbox"; + output = bsddialog_msgbox(&conf, "Example", 7, 20); + bsddialog_end(); - /* User Input */ - printf("User input: "); - switch (input) { - case BSDDIALOG_ERROR: printf("Error %s\n", bsddialog_geterror()); break; - case BSDDIALOG_OK: printf("OK\n"); break; - case BSDDIALOG_ESC: printf("ESC\n"); break; + switch (output) { + case BSDDIALOG_ERROR: + printf("Error %s\n", bsddialog_geterror()); + break; + case BSDDIALOG_OK: + printf("OK\n"); + break; } - return input; -} + return (output); +}
\ No newline at end of file |