shutefan
shutefan

Reputation: 6936

How to write an application that uses the terminal as GUI? (in C)

I'd like to write an application (in C) that uses the terminal of a *nix OS as its GUI. I mean an application of the kinds of emacs, vi etc. that take up the whole terminal window and jump back to the input prompt after quitting.
How would you go about doing that, preferably in C? Can someone point me to a tutorial covering that?

Upvotes: 8

Views: 15562

Answers (4)

jørgensen
jørgensen

Reputation: 10579

Throwing in alternate solutions so that this question thread does not look so monotonic:

  • the slang library (mc uses it, for example)

Upvotes: 2

RedComet
RedComet

Reputation: 1202

You need to use ncurses:

http://en.wikipedia.org/wiki/Ncurses
http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/

It is available on all major distros.

Upvotes: 8

fge
fge

Reputation: 121820

Use a library like ncurses, it is specifically designed for this purpose.

Upvotes: 2

MByD
MByD

Reputation: 137422

Well, actually this is not GUI (graphic user interface) but a text based interface. You can use the library ncurses to create such applications in C.

Upvotes: 4

Related Questions