#pragma ident "@(#) popmsg.c 1.0.1 2009.09.07,06:32"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <curses.h>
#include <locale.h>

int main(int argc,char *argv[])
{
	int i;
	int ch;
	char buff[80];
	WINDOW *pvs;

	if(argc == 2)
		sprintf(buff,"%s",argv[1]);
	else
		sprintf(buff,"Y か N を入力して下さい");

 	setlocale(LC_ALL,"");
	initscr();
	echo();

	pvs = newwin(6,64,LINES/2,8);
	box(pvs,'|','-');

	for(;;)
	{
		wattron(pvs,A_REVERSE);
		mvwprintw(pvs,0,1,"------------------- CMS Window Message ------------------------");
		wattroff(pvs,A_REVERSE);
		mvwprintw(pvs,0,0,"+");
		mvwprintw(pvs,0,63,"+");
		mvwprintw(pvs,5,0,"+");
		mvwprintw(pvs,5,63,"+");

		mvwprintw(pvs,2,4,"%s",buff);
		mvwprintw(pvs,4,30,"Y or N :");
		wrefresh(pvs);
		ch = wgetch(pvs);
		switch(ch)
		{
		case 'y': case 'Y':
			box(pvs,' ',' ');
			wclear(pvs);
			wrefresh(pvs);
			delwin(pvs);
			endwin();
			exit(1);
		case 'n': case 'N':
			box(pvs,' ',' ');
			wclear(pvs);
			wrefresh(pvs);
			delwin(pvs);
			endwin();
			exit(0);
		}
	}
}


