Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I think I'm doing this now using c and ncurses. So, I've got a c file that make a new screen and accepts up to 3 characters. Also, a makefile.
- Loading branch information
1 parent
056d9e2
commit a1490ab
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
menu: menu.o | ||
gcc -lncurses -o menu menu.o | ||
|
||
menu.o: menu.c | ||
gcc -c -o menu.o menu.c | ||
|
||
.PHONY: clean test run | ||
|
||
clean: | ||
rm -f menu | ||
rm -f menu.o | ||
|
||
test: run clean | ||
|
||
run: menu | ||
./menu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <ncurses.h> | ||
|
||
int main () { | ||
initscr(); | ||
char inp[4]; | ||
|
||
getnstr(&inp,3); | ||
inp[3]='\0'; | ||
|
||
endwin(); | ||
printf("You typed: %s\n",inp); | ||
return 0; | ||
} |