2 * SPDX-License-Identifier: CC0-1.0
4 * Written in 2021 by Alfonso Sabato Siciliano.
5 * To the extent possible under law, the author has dedicated all copyright
6 * and related and neighboring rights to this software to the public domain
7 * worldwide. This software is distributed without any warranty, see:
8 * <http://creativecommons.org/publicdomain/zero/1.0/>.
15 #include <bsddialog.h>
20 unsigned int hh, mm, ss;
21 struct bsddialog_conf conf;
26 localtm = localtime(&clock);
27 hh = localtm->tm_hour;
31 if (bsddialog_init() == BSDDIALOG_ERROR) {
32 printf("Error: %s\n", bsddialog_geterror());
36 bsddialog_initconf(&conf);
37 conf.title = "timebox";
38 conf.bottomtitle = "Press TAB and arrows";
39 output = bsddialog_timebox(&conf, "Example", 10, 50, &hh, &mm, &ss);
45 printf("Time: [%u:%u:%u]\n", hh, mm, ss);
47 case BSDDIALOG_CANCEL:
51 printf("Error: %s\n", bsddialog_geterror());