{"id":13577284,"url":"https://github.com/hollystandring/nmenu","last_synced_at":"2025-04-05T11:32:07.225Z","repository":{"id":102305701,"uuid":"212681695","full_name":"hollystandring/nmenu","owner":"hollystandring","description":"A 'plug and play' menu system for ncurses with automatic sizing and centering","archived":true,"fork":false,"pushed_at":"2024-07-30T13:41:44.000Z","size":1382,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-05T14:44:10.273Z","etag":null,"topics":["c","linux","ncurses"],"latest_commit_sha":null,"homepage":null,"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/hollystandring.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2019-10-03T21:15:20.000Z","updated_at":"2024-07-30T13:44:06.000Z","dependencies_parsed_at":"2024-07-30T16:30:02.954Z","dependency_job_id":null,"html_url":"https://github.com/hollystandring/nmenu","commit_stats":null,"previous_names":["hollystandring/nmenu"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollystandring%2Fnmenu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollystandring%2Fnmenu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollystandring%2Fnmenu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollystandring%2Fnmenu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hollystandring","download_url":"https://codeload.github.com/hollystandring/nmenu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247331312,"owners_count":20921763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["c","linux","ncurses"],"created_at":"2024-08-01T15:01:20.101Z","updated_at":"2025-04-05T11:32:06.770Z","avatar_url":"https://github.com/hollystandring.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# nmenu - ncurses menu system\nA 'plug and play' menu system for ncurses with automatic sizing and centering. Do it all with one function!\n![screenshot](https://raw.githubusercontent.com/hollystandring/nmenu/master/sshot.png)\n## Table of Contents\n- [Getting started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Installing and compiling](#installing-and-compiling)\n- [Running the test](#running-the-test)\n- [Including nmenu in projects](#including-nmenu-in-projects)\n- [Using nmenu](#using-nmenu)\n  - [Parameters](#parameters)\n  - [Examples](#examples)\n  - [Interacting with the menu](#interacting-with-the-menu)\n## Getting started\nThe following instructions will allow you to install nmenu locally for testing and development\n### Prerequisites\nThe following dependencies are required to be able to compile/run nmenu:\n* [ncurses](https://www.gnu.org/software/ncurses/)\n* [gcc](https://gcc.gnu.org/)\n### Installing and compiling\nRun the following command to clone nmenu and compile it for use in your projects:\n```\ngit clone https://github.com/hollystandring/nmenu\ncd nmenu\nmake\n```\nThe files 'test' and 'nmenu.o' will be created.\n## Running the tests\nOnce you have compiled nmenu, you can test to see if it is working by running 'test':\n```\n./test\n```\nYou should then be shown 4 menus in succession which (hopefully) look like this:\n![test1](https://raw.githubusercontent.com/hollystandring/nmenu/master/test1.png)\n![test2](https://raw.githubusercontent.com/hollystandring/nmenu/master/test2.png)\n![test3](https://raw.githubusercontent.com/hollystandring/nmenu/master/test3.png)\n![test4](https://raw.githubusercontent.com/hollystandring/nmenu/master/test4.png)\nAfter the last number, the values of the selected options will be output to the terminal:\n```\n./test\nChoice 1: 2\nChoice 2: 3\nChoice 3: 1\nChoice 4: 4\n```\nIf these tests do not show as expected, recompile and try again. If this does not fix it, please help by reporting the bug via the Issues tab.\n## Including nmenu in projects\nIn order to use nmenu in your ncurses project, first copy nmenu.h and nmenu.o to your project directory:\n```\ncp nmenu.h ~/path/to/myproject/\ncp nmenu.o ~/path/to/myproject/\n```\nAt the start of your .c file, be sure to include nmenu and ncurses:\n```\n#include\"nmenu.h\"\n#include\u003cncurses.h\u003e\n```\nWhen compiling your .c file with gcc, be sure to reference nmenu.o and ncurses:\n```\ngcc -o myproject main.c nmenu.o -lncurses\n```\n## Using nmenu\n### Parameters\nmenu() takes 6 parameters:\n* title - The text displayed at the top of the window. This should be short, probabaly one or two words\n* description - The text displayed inside the window\n* choices - An array of strings containing the choices to be displayed\n* choicesSize - The number of elements in the choices array. Unfortunatley sizeof() does not work in a parameter so this must be done manually.\n* vertical - If set to true, choices will be displayed vertically\n* centered - If set to true, choices will be centered in the middle of the window. This might not look as good if you're not careful with the length of your choices\n### Examples\n```\nchar *choices[2] = {\"Yes\", \"No\"};\n\nmenu(\"Confirm\", \"Are you sure you want to exit?\", choices, 2, true, true);\n```\n![example1](https://raw.githubusercontent.com/hollystandring/nmenu/master/example1.png)\n```\nchar *choices[5] = {\"1 \", \"2 \", \"3 \", \"4 \", \"5 \"};\n\nmenu(\"Amount\", \"Select the number of pages you want to print:\", choices, 5, false, true);\n```\n![example2](https://raw.githubusercontent.com/hollystandring/nmenu/master/example2.png)\n### Interacting with the menu\nTo navigate choices, the up, left, right, and down arrow keys can be used. The currently highlighted choice will have a white background\nTo select a choice, the enter and space keys can be used. This will return the value of the selected choice\nTo close the menu without selecting anything, the 'c' or escape key can be used. Using escape will be slower\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhollystandring%2Fnmenu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhollystandring%2Fnmenu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhollystandring%2Fnmenu/lists"}