Created
March 5, 2019 18:57
-
-
Save tbhaxor/e18a14d3048d7c1f04588439b5e1ff0d to your computer and use it in GitHub Desktop.
Windows in ncurses
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
#include <ncurses.h> | |
using namespace std; | |
int main(int argc, char **argv) | |
{ | |
initscr(); | |
// creating a window; | |
// with height = 15 and width = 10 | |
// also with start x axis 10 and start y axis = 20 | |
WINDOW *win = newwin(15, 17, 2, 10); | |
refresh(); | |
// making box border with default border styles | |
box(win, 0, 0); | |
// move and print in window | |
mvwprintw(win, 0, 1, "Greeter"); | |
mvwprintw(win, 1, 1, "Hello"); | |
// refreshing the window | |
wrefresh(win); | |
getch(); | |
endwin(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment