1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include <ncurses.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
WINDOW *create_newwin(int height, int width, int starty, int startx);
ncurse_affichage();
void ncurse_affichage()
{
WINDOW *my_win;
int startx, starty, width, height;
initscr();
height = 30; /* c est ici que je fournis les dimention pour la box ou la windows ? */
width = 100;
starty = (LINES - height) / 2; /* Calculating for a center placement */
startx = (COLS - width) / 2; /* of the window */
my_win = create_newwin(height, width, starty, startx);
}
WINDOW *create_newwin(int height, int width, int starty, int startx)
{ WINDOW *local_win;
local_win = newwin(height, width, starty, startx);
box(local_win, 0 , 0); /* 0, 0 gives default characters
* for the vertical and horizontal
* lines */
wrefresh(local_win); /* Show that box */
return local_win;
} |
Partager