Variation-ui is single-header terminal user interface library. Written in ansi-c. Simple to use, easy to learn and has small codebase. Also updatable thanks to MIT license (Look license if you want to know more).
gcc
> Gnu Compiler Collectionmake
> Gnu Make
You need to define #define VN_UI_IMPLEMENTATION
before #include "vn_ui.h"
#define VN_UI_IMPLEMENTATION
#include "vn_ui.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define VN_UI_IMPLEMENTATION // Base features
#define VN_WIDGET // Widget features
#include "vn_ui.h"
int main()
{
/* Color declaring */
char* color_fg_red = vn_color("#e93737", 'f');
char* color_bg_blue = vn_color("#3737e9", 'b');
/* Text attribute */
VN_UI_TEXT vnt;
strcpy(vnt.color_fg, color_fg_red);
strcpy(vnt.color_bg, color_bg_blue);
strcpy(vnt.text_style, vn_text_bold);
/* Widget values */
VN_UI_WIDGET vnw;
vnw.pos_x = 2;
vnw.pos_y = 2;
vnw.width = 20;
vnw.height = 10;
/* UI Section */
vn_bg(' ', vnt, vnw); // Background
vn_gotoxy((vnw.pos_x + vnw.width) / 2, (vnw.pos_y + vnw.height) / 2); // Go to middle
vn_print("This is the example.", 'y', vnt.color_fg, vnt.color_bg, vnt.text_style); // Colourful printing
vn_gotoxy((vnw.pos_x + vnw.width), (vnw.pos_y + vnw.height)); // Go to end
// Free after use 'vn_color'
free(color_fg_red);
free(color_bg_blue);
return 0;
}
Show make list
make
ormake run
make run
You can compile as shared-library and develope os specific projects.
make compile
Unix shared-library (.so)
Windows shared-library (.dll)
If you want to delete this file you can use
make clean
What if I want to use as default?
make install
- Variation: Binary - A binary analysis library in Ansi-C.