From c64f42b717240344bfb2bf7c5723f4833f4ac450 Mon Sep 17 00:00:00 2001 From: nick black Date: Sat, 22 Aug 2020 12:44:20 -0400 Subject: [PATCH] add sgr-full PoC --- src/poc/sgr-full.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/poc/sgr-full.c diff --git a/src/poc/sgr-full.c b/src/poc/sgr-full.c new file mode 100644 index 000000000..e6ca40a9a --- /dev/null +++ b/src/poc/sgr-full.c @@ -0,0 +1,34 @@ +#include +#include +#include + +int main(void){ + struct notcurses* nc = notcurses_init(NULL, NULL); + if(nc == NULL){ + return EXIT_FAILURE; + } + int dimy, dimx; + struct ncplane* n = notcurses_stddim_yx(nc, &dimy, &dimx); + ncplane_set_attr(n, NCSTYLE_NONE); + ncplane_putstr_yx(n, 0, 0, "a ═"); + ncplane_set_attr(n, NCSTYLE_ITALIC); + ncplane_putstr_yx(n, 1, 0, "a ═"); + ncplane_set_attr(n, NCSTYLE_BOLD); + ncplane_putstr_yx(n, 2, 0, "a ═"); + ncplane_set_attr(n, NCSTYLE_REVERSE); + ncplane_putstr_yx(n, 3, 0, "a ═"); + ncplane_set_attr(n, NCSTYLE_UNDERLINE); + ncplane_putstr_yx(n, 4, 0, "a ═"); + if(notcurses_render(nc)){ + goto err; + } + sleep(5); + if(notcurses_stop(nc)){ + return EXIT_FAILURE; + } + return EXIT_SUCCESS; + +err: + notcurses_stop(nc); + return EXIT_FAILURE; +}