Path: blob/main/contrib/bsddialog/examples_library/rangebox.c
39476 views
/*-1* SPDX-License-Identifier: CC0-1.02*3* Written in 2021 by Alfonso Sabato Siciliano.4* To the extent possible under law, the author has dedicated all copyright5* and related and neighboring rights to this software to the public domain6* worldwide. This software is distributed without any warranty, see:7* <http://creativecommons.org/publicdomain/zero/1.0/>.8*/910#include <bsddialog.h>11#include <stdio.h>1213int main()14{15int value, output;16struct bsddialog_conf conf;1718if (bsddialog_init() == BSDDIALOG_ERROR) {19printf("Error: %s\n", bsddialog_geterror());20return (1);21}22bsddialog_initconf(&conf);23conf.title = "rangebox";24value = 5;25output = bsddialog_rangebox(&conf, "Example", 8, 50, 0, 10, &value);26bsddialog_end();27if (output == BSDDIALOG_ERROR) {28printf("Error: %s\n", bsddialog_geterror());29return (1);30}31printf("Value: %d\n", value);3233return (0);34}3536