Skip to content

Instantly share code, notes, and snippets.

@tbhaxor
Created March 5, 2019 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbhaxor/e18a14d3048d7c1f04588439b5e1ff0d to your computer and use it in GitHub Desktop.
Save tbhaxor/e18a14d3048d7c1f04588439b5e1ff0d to your computer and use it in GitHub Desktop.
Windows in ncurses
#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