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

旧时模样 提交于 2019-12-21 16:21:34

问题


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?


回答1:


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.




回答2:


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.




回答3:


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




回答4:


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

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


来源:https://stackoverflow.com/questions/8547033/how-to-write-an-application-that-uses-the-terminal-as-gui-in-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!