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/>.
11 #include <bsddialog.h>
19 unsigned int hh, mm, ss;
20 struct bsddialog_conf conf;
25 localtm = localtime(&clock);
26 hh = localtm->tm_hour;
30 if (bsddialog_init() == BSDDIALOG_ERROR) {
31 printf("Error: %s\n", bsddialog_geterror());
35 bsddialog_initconf(&conf);
36 conf.title = "timebox";
37 output = bsddialog_timebox(&conf, "Example", 9, 35, &hh, &mm, &ss);
43 printf("Time: [%u:%u:%u]\n", hh, mm, ss);
45 case BSDDIALOG_CANCEL:
49 printf("Error: %s\n", bsddialog_geterror());