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).
If you don't need widget, then there's a lite version of this library. It's also optimized and simplified and contains no widgets. Variation Lite UI
gcc
> Gnu Compiler Collectionmake
> Gnu Make
You can install with package managers for linux.
You need to define #define VN_UI_IMPLEMENTATION
before #include "vn_ui.h"
#define VN_UI_IMPLEMENTATION
#include "vn_ui.h"
#include <stdio.h>
#define VN_UI_IMPLEMENTATION
#define VN_COLOR
#define VN_WIDGET
#include "vn_ui.h"
int main()
{
struct vn_init vn;
vn.width = 60;
vn.height = 5;
vn.pos_x = 2;
vn.pos_y = 2;
struct vnc_color white;
struct vnc_color black;
white.is_fore = 0;
white.color = vn_hex_color("e9e9e9", white.is_fore);
black.is_fore = 1;
black.color = vn_rgb_color(22, 22, 22, black.is_fore);
char* msg = "This is the example. If you had a trouble please leave an issue to https://github.com/hanilr/variation/issues have fun!";
vn_clear();
vn_label(vn.pos_x, vn.pos_y, vn.width, vn.height, black.color, white.color, text_italic, msg);
vn_end(vn);
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)
If you want to delete this file you can use
make clean
What if I want to use as default?
make install
If you only want to download library with terminal then use curl tool
curl -fLo /usr/include/vn/vn_ui.h --create-dirs https://raw.githubusercontent.com/hanilr/variation-ui/master/vn_ui.h
If you use curl tool then you need to compile with sudo.
You can find in
/usr/include/vn/
If you want to uninstall you can use
make uninstall
MIT License
Copyright (c) 2022 Hakkı Anıl Ragıboğlu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.