Skip to content

Commit

Permalink
Merge branch 'Newt'
Browse files Browse the repository at this point in the history
  • Loading branch information
steveh250 committed Oct 28, 2020
2 parents 5e3805e + 4b4f307 commit 923db23
Show file tree
Hide file tree
Showing 6 changed files with 411 additions and 265 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
/menu
/newt4
/newt4.c
/newt
/newt.c
/newt2
/newt2.c
/newt3
/newt3.c
testnewt.c
newtmenu
testnewt
newtmenu.c
/newtmenu.c
*.swp
menufile3
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,27 @@ NOTE:
- The menu app will decide whether to draw the menu in one or two columns depending on how many entries are in the menufile.
- If you use it or modify it, I'd appreciate a mention in the source code (taking into account [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) ) - drop me an email to let me know what you're using it for, I'd be really interested.

![](menu-gif2.gif)
![](menu-gif3.gif)

Build on Ubuntu 16.04
=====================
1. Install curses libraries: `sudo apt-get install libncurses5-dev libncursesw5-dev`
2. Compile the menu.c: `gcc -v -o menu menu.c -lncurses`
3. Create a menu file - sample in repo
4. Start it up: `./menu menufile`
2. Install newt libraries: `sudo apt-get install libnewt-dev`
3. Compile the menu.c: `gcc -o menu menu.c -lncurses`
4. Create a menu file - sample in repo
5. Start it up - see usage below

Usage
=====
- `$ menu -c menufile` (display the menufile using simple curses based menu)
- `$ menu -n menufile` (display the menufile using newt character graphics menu)
- NOTE: In the menufile you can call menus of other types (e.g. a newt menu can call a curses menu) but you have to hard code that into the menufile - example in the repo (menufile calls menufile2 as a curses menu).

menufile - format
=================
- Max length of each line - 80 chars.
- NOTE: IF you exceed these lenghts it will mess your menu's up
- Max lengh of description line is 30 chars
- Max length of each command line - 80 chars.
- NOTE: If you're in any doubt about the length of the command, wrap it up in a script (you wouldn't want your 'rm' command to land on the 80 char boundary :).
- Max number of options - 30.

Expand All @@ -44,6 +53,7 @@ As time permits - here's the plan:
- General code improvements
- [x] Changed kerbpass to passwd
- [x] Fixed a bug where after an execution the menu would redraw and leave the last menu option number selected displayed at the bottom of the screen - there was an redundant printw() - echo() had already been set.
- [ ] Handle the lines longer than 30 or 80 chars so it doesn't mess up the menu

Licensing
=========
Expand Down
Binary file removed menu-gif2.gif
Binary file not shown.
Binary file added menu-gif3.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 923db23

Please sign in to comment.