[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

open windows win Linux



I try to open a new window in Linux (under XF86 + kde) but with no
success .
I have no  idea why this doesn't work :

#include <ncurses.h>
#include <stdio.h>
#include <stdlib.h>
#define MYLINE (int)  ((LINES-22)/2)
#define MYCOL ((COLS-70)/2)
#define MYLINES 22
#define MYCOLS 70

int main (){
  WINDOW * win;
  long i,j;
  printf ("%s\n","hello ! This prog will open a new win ");
  if ( !(initscr()) ) {
   fprintf(stderr,"type: initscr() failed\n\n");
 exit(1);
  }
  if ( (LINES < 22)|| (COLS < 70) )  {
 fprintf(stderr,"screen too small\n\n");
 exit(1);
  }

  win = newwin(MYLINES, MYCOLS, MYLINE, MYCOL);
  refresh();
  printf("bye\n");
  endwin();
  return 0;