hello
Je cherche a obtenir la taille de la Fenetre principal afin de pouvoir la diviser en 2 a la verticale. un peux comme mignight commander, mai vraiment 2 fenetre séparée et indépendante.
Note Je decouvre ncuse et également le c++ (bon le c++ depuis 2 ou 3 mois sa commence a rentrer)
je me suis trouver l’unique doc en anglait , rien en français pour le moment
ici: tldp.org/HOWTO/NCURSES-Progra…WTO/index.html
mai j’ai rien trouver en ce qui concerne mon probleme car c’est a moi de fournir les première cordonné aux pif. pour la première (box ?) avec le code suivant:
la fonction ncurse_affichage(); peux etre remplacée par le main aux besoin (ou si sa bug …)
#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;
}
Merci d’avance