GitHub - ggerganov/imtui: ImTui: Immediate Mode Text-based User Interface
source link: https://github.com/ggerganov/imtui
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
imtui
ImTui is an immediate mode text-based user interface library. Supports 256 ANSI colors and mouse/keyboard input.
Live demo in the browser
Eventhough this library is supposed to be used in the terminal, for convenience here is an Emscripten build to demonstrate what it would look like, by simulating a console in the browser:
- Demo 0: imtui.ggerganov.com
- Demo 1: hnterm.ggerganov.com
Note: the demos work best with Chrome
Details
This library is 99.9% based on the popular Dear ImGui library. ImTui simply provides an ncurses interface in order to draw and interact with widgets in the terminal. The entire Dear ImGui interface is available out-of-the-box.
For basic usage of ImTui, check one of the available samples:
- example-ncurses0
- example-emscripten0
- hnterm - a simple tool to browse Hacker News in the terminal
Note: the current implementation is experimental, so don't expect all things to work.
Building
ImTui depends only on libncurses
Linux and Mac:
git clone https://github.com/ggerganov/imtui --recursive cd imtui mkdir build && cd build cmake .. make ./bin/imtui-example-ncurses0
Emscripten:
git clone https://github.com/ggerganov/imtui --recursive cd imtui mkdir build && cd build emconfigure cmake .. make
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK