Wednesday, December 18, 2013

           TUI(Textual User interface) using N-Curses


Ncurses: A brief introduction

Ncurses (new curses) is a programming library that provides an API which allows the programmer to write text-based user interfaces in a terminal-independent manner. It is a toolkit for developing "GUI-like" application software that runs under a terminal emulator. It also optimizes screen changes, in order to reduce the latency experienced when using remote shells

So with the help of Ncurses we can build Textual user interface based applications that can be used on any Linux based systems with limited amount of processing power.

I think there is no requirement to tell difference between a TYI and a GUI, but for reference have a look at the images below.

A Sample GUI screen
A sample TUI
So with this its quite clear that what is the basic difference between a GUI and TUI

Now basically there are many Libraries for making TUI that can be embedded with in a small embedded system with limited resource and high amount of priority based task seeking for more RAM for their processing, in that scenario TUI can be a preferable option.

Ncurses can be used with C or C++ or even with python(other programming variables are also supported, have a look at this link for more info in this regards)

I prefer to use C as C is the most basic language that any body not belonging to software field can learn and use(for mid level expert software's).Myself belonging to Electronics domain and that too my experience till now was in Embedded field,so i prefer to use C as a programming language for using Ncurses.

I got a chance to work on Ncurses in Thinvent Technologies Pvt limited.Project was to build a TUI menu for Railways Dumb terminals and thinclients. Generally TUI was build with the help of bash scripts which were vulnerable for reverse engineering easily and that's why instead of porting a script in thincliens, we thought to port a C binary.

I am sharing links for the tutorials which i used to learn Ncurses with C and build up a demo App for Thinvent. Though it was never used, but i had a good experience in learning Ncurses and getting in depth linux based systems.I will soon update github repo with respect to the code and will further keep on working for the same.

iv)   And one whose help i took to build up the Demo app as show below
       http://www.linuxfocus.org/English/March2002/article233.shtml


I will further update the article with more information and further development.

No comments:

Post a Comment