{"id":27734704,"url":"https://github.com/josephtlyons/ncurses-ui-library","last_synced_at":"2026-05-14T21:04:04.664Z","repository":{"id":110868845,"uuid":"180095381","full_name":"JosephTLyons/nCurses-UI-Library","owner":"JosephTLyons","description":"A small Terminal UI library that wraps around the nCurses library.  WIP.","archived":false,"fork":false,"pushed_at":"2020-01-09T06:01:44.000Z","size":1389,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-13T11:45:52.397Z","etag":null,"topics":["framework","ncurses","ncurses-library","ui"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JosephTLyons.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-04-08T07:37:45.000Z","updated_at":"2022-01-26T04:26:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"fe6f4814-8291-47a0-bd63-97abd9a21905","html_url":"https://github.com/JosephTLyons/nCurses-UI-Library","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JosephTLyons/nCurses-UI-Library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JosephTLyons%2FnCurses-UI-Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JosephTLyons%2FnCurses-UI-Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JosephTLyons%2FnCurses-UI-Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JosephTLyons%2FnCurses-UI-Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JosephTLyons","download_url":"https://codeload.github.com/JosephTLyons/nCurses-UI-Library/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JosephTLyons%2FnCurses-UI-Library/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33043249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["framework","ncurses","ncurses-library","ui"],"created_at":"2025-04-28T13:39:42.539Z","updated_at":"2026-05-14T21:04:04.646Z","avatar_url":"https://github.com/JosephTLyons.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nCurses UI Library\n\n## Description\n- This UI library aims to make it easy to construct and use windows within the\n  command line.  The library uses ncurses under the hood, so that must be\n  installed on your system.  This library was only tested on a macOS machine;\n  there is no guarantee runs correctly, or even at all, on any other machines.\n\n## Background\n- This library was originally developed to manage the UI for a simulated\n  operating system developed by\n  [Shaun Whitfield](https://github.com/shaunwhitfield) and I for our Operating\n  Systems course.  Shaun and I split many of the tasks; I wrote this UI library\n  and felt it would be an interesting to use it outside of that project, so I've\n  placed it inside of its own repository.\n\n## UI Methods Explained\n-\n-\n-\n...\n\n## How to Use\n\n### Small Example: Titled Window:\n\nThis example shows how simple it is to make a titled window with centered text.\n\n```C++\n#include \"UI.hpp\"\n\nint main()\n{\n    UI ui;\n    ui.make_new_window (1, 1, 20, 10, \"Main Window\", true);\n    ui.write_to_window (0, \"Hello World!\", false);\n    ui.pause_until_input();\n}\n```\n\n![Small Example](./Images/Small-Example-Titled.png)\n\n### Small Example: Non-Titled Window:\n\nOf course, our windows do not have to have titles at all.  We can omit them and\nuse the extra line as printable space.  All we have to do pass in an empty\nstring for the window title parameter into the `make_new_window()` function and\nthe window will not display a title\n\n```C++\n...\nui.make_new_window (1, 1, 20, 10, \"\", true);\n...\n```\n\n![Small Example](./Images/Small-Example-Non-Titled.png)\n\nThis example illustrates how to create multiple titled windows and how to allow\nfor live input.  Using `const int`s makes it easy to keep all windows uniform\nand allows for quickly changing all windows at once.  Using an `enum` makes\nremembering which window is which simple.\n\n### Large Example:\n\n```C++\n#include \"UI.hpp\"\n\nint main()\n{\n    // Declare UI object\n    UI ui;\n\n    // Helper ints to make changing this particular UI configuration simple\n    const unsigned int x = 1;\n    const unsigned int y = 1;\n    const unsigned int width = 30;\n    const unsigned int height = 20;\n    const unsigned int x_window_distance = 2;\n\n    // Make windows\n    // Note: window creation is a dynamic procedure\n    ui.make_new_window (x + (0 * (x_window_distance + width)), y, width, height, \"Left Window\", false);\n    ui.make_new_window (x + (1 * (x_window_distance + width)), y, width, height, \"Middle Window\", false);\n    ui.make_new_window (x + (2 * (x_window_distance + width)), y, width, height, \"Right Window\", false);\n\n    // Enumerations to make remembering a window easier\n    enum windows\n    {\n        left,\n        middle,\n        right,\n    };\n\n    ui.write_to_all_windows (std::to_string (ui.get_number_of_windows()), true);\n\n    // Random character used to break input loops and advance to the next window\n    const char input_break = '.';\n\n    // Live input into each of the windows\n    while (ui.live_input (left,   false) != input_break);\n    while (ui.live_input (middle, false) != input_break);\n    while (ui.live_input (right,  false) != input_break);\n}\n```\n\n![Large Example](./Images/Large-Example.png)\n\nAn example makefile for the previous examples\n\n```makefile\nBIN_NAME = nCurses_UI_Library_Test\nLIBRARIES = -lncurses\nOBJECT_FILES = main.o UI.o Window.o Write.o\nCXXFLAGS = -std=c++17\n\n$(BIN_NAME): $(OBJECT_FILES)\n\tg++ -o $(BIN_NAME) $(OBJECT_FILES) $(LIBRARIES)\n\nmain.o: main.cpp\n\tg++ $(CXXFLAGS) -c main.cpp\n\nUI.o: UI.cpp UI.hpp Window.hpp\n\tg++ $(CXXFLAGS) -c UI.cpp\n\nWindow.o: Window.cpp Window.hpp Write.hpp\n\tg++ $(CXXFLAGS) -c Window.cpp\n\nWrite.o: Write.cpp Write.hpp\n\tg++ $(CXXFLAGS) -c Write.cpp\n\nclean:\n\trm -rf *.o\n\trm -rf *.out\n\trm -rf *~\n\trm $(BIN_NAME)\n\nrun:\n\t./$(BIN_NAME)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosephtlyons%2Fncurses-ui-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosephtlyons%2Fncurses-ui-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosephtlyons%2Fncurses-ui-library/lists"}