Newsgroup: it.comp.lang.c
Titolo: N curses 2 la vendetta

Perchè questo codice non mi scrive nel box e me ne disegna solo 1?????
Ho sbagliato qulacosa???
#include <curses.h>
WINDOW *create_newwin(int height, int width, int starty, int startx);
void destroy_win(WINDOW *local_win);
void screen_unload(void);
int screen_int(void);
WINDOW *my_win1;
WINDOW *my_win2;
//WINDOW *my_win3;
int main(int argc, char *argv[])
{
	int startx, starty, width, height;
	int ch;
	screen_int();					 
 
	keypad(stdscr, TRUE);		/* I need that nifty F1 	*/
 
	init_pair(1, COLOR_RED, COLOR_BLACK);
 
	height = 15;
	width = 25;
	starty = 0;	/* Calculating for a center placement */
	startx = 25;	/* of the window		*/
	mvprintw(10,20,"Press any key to exit");
	my_win2 = create_newwin(height, width, starty, startx);
	wrefresh(my_win2);
	height = 20;
	width = 25;
	starty = 0;	/* Calculating for a center placement */
	startx = 0;	/* of the window		*/
	my_win1 = create_newwin(height, width, starty, startx);
	wrefresh(my_win1);
 
 
	mvwprintw(my_win1, 0, 0, " Prova");
 
 
 
	refresh();
 
	ch = getch();
	refresh();	
	screen_unload();
	return 0;
}
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;
}
void destroy_win(WINDOW *local_win)
{	
	/* box(local_win, ' ', ' '); : This won't produce the desired
	 * result of erasing the window. It will leave it's four corners 
	 * and so an ugly remnant of window. 
	 */
	wborder(local_win, ' ', ' ', ' ',' ',' ',' ',' ',' ');
	/* The parameters taken are 
	 * 1. win: the window on which to operate
	 * 2. ls: character to be used for the left side of the window 
	 * 3. rs: character to be used for the right side of the window 
	 * 4. ts: character to be used for the top side of the window 
	 * 5. bs: character to be used for the bottom side of the window 
	 * 6. tl: character to be used for the top left corner of the 
window 
	 * 7. tr: character to be used for the top right corner of the 
window 
	 * 8. bl: character to be used for the bottom left corner of the 
window 
	 * 9. br: character to be used for the bottom right corner of the 
window
	 */
	wrefresh(local_win);
	delwin(local_win);
}
int screen_int(void)
{
 
  /* ESSENZIALE */
    	(void) initscr();      /* inizializza la libreria curses */
  /* non essenziale */
    	keypad(stdscr, TRUE);  /* abilita la mappatura della tastiera */
    	(void) nonl();         /* non convertire NL->CR/NL in output */
    	(void) cbreak();       /* prende i caratteri in input uno alla 
volta
                            * senza attendere il \n */
    	(void) noecho();       /* nessuna echo dell'input */
    	(void) start_color();
	if(has_colors() == FALSE)
	{	endwin();
		printf("You terminal does not support color\n");
		exit(1);
	}
	start_color();			/* Start color 
			*/
 
	return(0);
}	
void screen_unload(void)
{
	endwin();
}	
     GRAZIE
     <<SAX>>
Per conttarmi togliere TOGLIMI dall'indirizzo email in firma
 
mail:linefin...@tiscalinet.it




si`, a fare il multipost.
[Followup-To: it.comp.os.linux.development ]
Adieu,
-- 
Lestat de Lioncourt                               |          Ciro Mattia Gonano
  JabberID: 
les...@jabber.students.cs.unibo.it
    |    Undergraduate Student in
  ICQ#: 52631406                                  |         Computer Science at
  URL: 
http://www.CS.UniBO.It/~gonano
             |       University of Bologna
            <powered by Linux Slackware 8.1 on Kernel 2.4.18-xfs>