diff options
Diffstat (limited to 'examples_library/timebox.c')
-rw-r--r-- | examples_library/timebox.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/examples_library/timebox.c b/examples_library/timebox.c index 117d45dcdb7b..6e3721ea9188 100644 --- a/examples_library/timebox.c +++ b/examples_library/timebox.c @@ -28,24 +28,22 @@ int main() mm = localtm->tm_min; ss = localtm->tm_sec; + if (bsddialog_init() == BSDDIALOG_ERROR) { + printf("Error: %s\n", bsddialog_geterror()); + return (1); + } + bsddialog_initconf(&conf); conf.title = "timebox"; conf.bottomtitle = "Press TAB and arrows"; - - if (bsddialog_init() < 0) - return -1; - output = bsddialog_timebox(&conf, "Example", 10, 50, &hh, &mm, &ss); - + bsddialog_end(); switch (output) { case BSDDIALOG_OK: printf("Time: [%u:%u:%u]\n", hh, mm, ss); break; - case BSDDIALOG_ESC: - printf("ESC\n"); - break; case BSDDIALOG_CANCEL: printf("Cancel\n"); break; @@ -54,5 +52,5 @@ int main() break; } - return output; -} + return (output); +}
\ No newline at end of file |