Esempio n. 1
0
int show_info(CDKSCREEN *screen)
{
	char *title = "<C>Wifi Info";
	char *mesg;
	CDKSWINDOW *swindow;

	swindow = newCDKSwindow(screen, CENTER, CENTER,
			0, 0, title, 100, TRUE, FALSE);

	mesg = "<C>Use the Arrow to move window.";
	addCDKSwindow(swindow, mesg, BOTTOM);
	mesg = "<C>Hit Enter to exit.";
	addCDKSwindow(swindow, mesg, BOTTOM);

	execCDKSwindow(swindow, "iwlist scanning 2>/dev/null", BOTTOM);

	activateCDKSwindow(swindow, 0);

	destroyCDKSwindow(swindow);
	return 0;
}
Esempio n. 2
0
/*
 * Demonstrate a scrolling-window.
 */
int main (int argc, char **argv)
{
   /* Declare variables. */
   CDKSCREEN *cdkscreen = 0;
   CDKSWINDOW *swindow	= 0;
   WINDOW *cursesWin	= 0;
   char *title		= "<C></5>Error Log";
   char *mesg[5];

   CDK_PARAMS params;

   CDKparseParams(argc, argv, &params, CDK_CLI_PARAMS);

   /* Set up CDK. */
   cursesWin = initscr();
   cdkscreen = initCDKScreen (cursesWin);

   /* Start CDK colors. */
   initCDKColor();

   /* Create the scrolling window. */
   swindow = newCDKSwindow (cdkscreen,
			   CDKparamValue(&params, 'X', CENTER),
			   CDKparamValue(&params, 'Y', CENTER),
			   CDKparamValue(&params, 'H', 6),
			   CDKparamValue(&params, 'W', 65),
			   title, 100,
			   CDKparamValue(&params, 'N', TRUE),
			   CDKparamValue(&params, 'S', FALSE));

   /* Is the window null. */
   if (swindow == 0)
   {
      /* Exit CDK. */
      destroyCDKScreen (cdkscreen);
      endCDK();

      /* Print out a message and exit. */
      printf ("Oops. Can not seem to create the scrolling window. Is the window too small??\n");
      ExitProgram (EXIT_FAILURE);
   }

   /* Draw the scrolling window. */
   drawCDKSwindow (swindow, ObjOf(swindow)->box);

   /* Load up the scrolling window. */
   addCDKSwindow (swindow, "<C></11>TOP: This is the first line.", BOTTOM);
   addCDKSwindow (swindow, "<C>Sleeping for 1 second.", BOTTOM);
   sleep (1);

   addCDKSwindow (swindow, "<L></11>1: This is another line.", BOTTOM);
   addCDKSwindow (swindow, "<C>Sleeping for 1 second.", BOTTOM);
   sleep (1);

   addCDKSwindow (swindow, "<C></11>2: This is another line.", BOTTOM);
   addCDKSwindow (swindow, "<C>Sleeping for 1 second.", BOTTOM);
   sleep (1);

   addCDKSwindow (swindow, "<R></11>3: This is another line.", BOTTOM);
   addCDKSwindow (swindow, "<C>Sleeping for 1 second.", BOTTOM);
   sleep (1);

   addCDKSwindow (swindow, "<C></11>4: This is another line.", BOTTOM);
   addCDKSwindow (swindow, "<C>Sleeping for 1 second.", BOTTOM);
   sleep (1);

   addCDKSwindow (swindow, "<L></11>5: This is another line.", BOTTOM);
   addCDKSwindow (swindow, "<C>Sleeping for 1 second.", BOTTOM);
   sleep (1);

   addCDKSwindow (swindow, "<C></11>6: This is another line.", BOTTOM);
   addCDKSwindow (swindow, "<C>Sleeping for 1 second.", BOTTOM);
   sleep (1);

   addCDKSwindow (swindow, "<C>Done. You can now play.", BOTTOM);

   addCDKSwindow (swindow, "<C>This is being added to the top.", TOP);

   /* Activate the scrolling window. */
   activateCDKSwindow (swindow, 0);

   /* Check how the user exited this widget. */
   if (swindow->exitType == vESCAPE_HIT)
   {
      mesg[0] = "<C>You hit escape to leave this widget.";
      mesg[1] = "";
      mesg[2] = "<C>Press any key to continue.";
      popupLabel (cdkscreen, mesg, 3);
   }
   else if (swindow->exitType == vNORMAL)
   {
      mesg[0] = "<C>You hit return to exit this widget.";
      mesg[1] = "";
      mesg[2] = "<C>Press any key to continue.";
      popupLabel (cdkscreen, mesg, 3);
   }

   /* Clean up. */
   destroyCDKSwindow (swindow);
   destroyCDKScreen (cdkscreen);
   endCDK();
   ExitProgram (EXIT_SUCCESS);
}
Esempio n. 3
0
/*
 * Run the Device/Target Group Layout dialog
 */
void devTgtGrpLayoutDialog(CDKSCREEN *main_cdk_screen) {
    CDKSWINDOW *alua_info = 0;
    char *swindow_info[MAX_ALUA_LAYOUT_LINES] = {NULL};
    int i = 0, line_pos = 0;
    char dir_name[MAX_SYSFS_PATH_SIZE] = {0},
            tmp_buff[MAX_SYSFS_ATTR_SIZE] = {0};
    DIR *dev_grp_dir_stream = NULL, *tgt_grp_dir_stream = NULL,
            *tgt_dir_stream = NULL, *dev_dir_stream = NULL;
    struct dirent *dev_grp_dir_entry = NULL, *tgt_grp_dir_entry = NULL,
            *tgt_dir_entry = NULL, *dev_dir_entry = NULL;

    /* Setup scrolling window widget */
    alua_info = newCDKSwindow(main_cdk_screen, CENTER, CENTER,
            (ALUA_LAYOUT_ROWS + 2), (ALUA_LAYOUT_COLS + 2),
            "<C></31/B>SCST ALUA Device/Target Group Layout\n",
            MAX_ALUA_LAYOUT_LINES, TRUE, FALSE);
    if (!alua_info) {
        errorDialog(main_cdk_screen, SWINDOW_ERR_MSG, NULL);
        return;
    }
    setCDKSwindowBackgroundAttrib(alua_info, COLOR_DIALOG_TEXT);
    setCDKSwindowBoxAttribute(alua_info, COLOR_DIALOG_BOX);

    line_pos = 0;
    while (1) {
        /* We'll start with the SCST device groups */
        snprintf(dir_name, MAX_SYSFS_PATH_SIZE,
                "%s/device_groups", SYSFS_SCST_TGT);
        if ((dev_grp_dir_stream = opendir(dir_name)) == NULL) {
            if (line_pos < MAX_ALUA_LAYOUT_LINES) {
                SAFE_ASPRINTF(&swindow_info[line_pos], "opendir(): %s",
                        strerror(errno));
                line_pos++;
            }
            break;
        }
        while ((dev_grp_dir_entry = readdir(dev_grp_dir_stream)) != NULL) {
            /* The device group names are directories; skip '.' and '..' */
            if ((dev_grp_dir_entry->d_type == DT_DIR) &&
                    (strcmp(dev_grp_dir_entry->d_name, ".") != 0) &&
                    (strcmp(dev_grp_dir_entry->d_name, "..") != 0)) {
                if (line_pos < MAX_ALUA_LAYOUT_LINES) {
                    SAFE_ASPRINTF(&swindow_info[line_pos],
                            "</B>Device Group:<!B> %s",
                            dev_grp_dir_entry->d_name);
                    line_pos++;
                }

                /* Now get all of the device names for this device group */
                snprintf(dir_name, MAX_SYSFS_PATH_SIZE,
                        "%s/device_groups/%s/devices",
                        SYSFS_SCST_TGT, dev_grp_dir_entry->d_name);
                if ((dev_dir_stream = opendir(dir_name)) == NULL) {
                    if (line_pos < MAX_ALUA_LAYOUT_LINES) {
                        SAFE_ASPRINTF(&swindow_info[line_pos],
                                "opendir(): %s", strerror(errno));
                        line_pos++;
                    }
                    break;
                }
                while ((dev_dir_entry = readdir(dev_dir_stream)) != NULL) {
                    /* The device names are links */
                    if (dev_dir_entry->d_type == DT_LNK) {
                        if (line_pos < MAX_ALUA_LAYOUT_LINES) {
                            SAFE_ASPRINTF(&swindow_info[line_pos],
                                    "\t</B>Device:<!B> %s",
                                    dev_dir_entry->d_name);
                            line_pos++;
                        }
                    }
                }
                closedir(dev_dir_stream);

                /* Now get all of the target groups for this device group */
                snprintf(dir_name, MAX_SYSFS_PATH_SIZE,
                        "%s/device_groups/%s/target_groups", SYSFS_SCST_TGT,
                        dev_grp_dir_entry->d_name);
                if ((tgt_grp_dir_stream = opendir(dir_name)) == NULL) {
                    if (line_pos < MAX_ALUA_LAYOUT_LINES) {
                        SAFE_ASPRINTF(&swindow_info[line_pos], "opendir(): %s",
                                strerror(errno));
                        line_pos++;
                    }
                    break;
                }
                while ((tgt_grp_dir_entry = readdir(tgt_grp_dir_stream)) !=
                        NULL) {
                    /* The target group names are directories;
                     * skip '.' and '..' */
                    if ((tgt_grp_dir_entry->d_type == DT_DIR) &&
                            (strcmp(tgt_grp_dir_entry->d_name, ".") != 0) &&
                            (strcmp(tgt_grp_dir_entry->d_name, "..") != 0)) {
                        if (line_pos < MAX_ALUA_LAYOUT_LINES) {
                            snprintf(dir_name, MAX_SYSFS_PATH_SIZE,
                            "%s/device_groups/%s/target_groups/%s/group_id",
                            SYSFS_SCST_TGT, dev_grp_dir_entry->d_name,
                                    tgt_grp_dir_entry->d_name);
                            readAttribute(dir_name, tmp_buff);
                            SAFE_ASPRINTF(&swindow_info[line_pos],
                                    "\t</B>Target Group:<!B> %s (Group ID: %s)",
                                    tgt_grp_dir_entry->d_name, tmp_buff);
                            line_pos++;
                        }

                        /* Loop over each target name for the
                         * current target group */
                        snprintf(dir_name, MAX_SYSFS_PATH_SIZE,
                                "%s/device_groups/%s/target_groups/%s",
                                SYSFS_SCST_TGT, dev_grp_dir_entry->d_name,
                                tgt_grp_dir_entry->d_name);
                        if ((tgt_dir_stream = opendir(dir_name)) == NULL) {
                            if (line_pos < MAX_ALUA_LAYOUT_LINES) {
                                SAFE_ASPRINTF(&swindow_info[line_pos],
                                        "opendir(): %s", strerror(errno));
                                line_pos++;
                            }
                            break;
                        }
                        while ((tgt_dir_entry = readdir(tgt_dir_stream)) !=
                                NULL) {
                            /* The target names are links (if local),
                             * or directories (if remote); skip '.' and '..' */
                            if (((tgt_dir_entry->d_type == DT_DIR) &&
                                    (strcmp(tgt_dir_entry->d_name,
                                    ".") != 0) &&
                                    (strcmp(tgt_dir_entry->d_name,
                                    "..") != 0)) ||
                                    (tgt_dir_entry->d_type == DT_LNK)) {
                                if (line_pos < MAX_ALUA_LAYOUT_LINES) {
                                    snprintf(dir_name, MAX_SYSFS_PATH_SIZE,
                                            "%s/device_groups/%s/"
                                            "target_groups/%s/%s/rel_tgt_id",
                                            SYSFS_SCST_TGT,
                                            dev_grp_dir_entry->d_name,
                                            tgt_grp_dir_entry->d_name,
                                            tgt_dir_entry->d_name);
                                    readAttribute(dir_name, tmp_buff);
                                    SAFE_ASPRINTF(&swindow_info[line_pos],
                                            "\t\t</B>Target:<!B> %s "
                                            "(Rel Tgt ID: %s)",
                                            tgt_dir_entry->d_name, tmp_buff);
                                    line_pos++;
                                }
                            }
                        }
                        closedir(tgt_dir_stream);
                    }
                }
                closedir(tgt_grp_dir_stream);

                /* Print a blank line to separate targets */
                if (line_pos < MAX_ALUA_LAYOUT_LINES) {
                    SAFE_ASPRINTF(&swindow_info[line_pos], " ");
                    line_pos++;
                }
            }
        }
        closedir(dev_grp_dir_stream);
        break;
    }

    /* Add a message to the bottom explaining how to close the dialog */
    if (line_pos < MAX_ALUA_LAYOUT_LINES) {
        SAFE_ASPRINTF(&swindow_info[line_pos], " ");
        line_pos++;
    }
    if (line_pos < MAX_ALUA_LAYOUT_LINES) {
        SAFE_ASPRINTF(&swindow_info[line_pos], CONTINUE_MSG);
        line_pos++;
    }

    /* Set the scrolling window content */
    setCDKSwindowContents(alua_info, swindow_info, line_pos);

    /* The 'g' makes the swindow widget scroll to the top, then activate */
    injectCDKSwindow(alua_info, 'g');
    activateCDKSwindow(alua_info, 0);

    /* We fell through -- the user exited the widget, but we don't care how */
    destroyCDKSwindow(alua_info);

    /* Done */
    for (i = 0; i < MAX_ALUA_LAYOUT_LINES; i++)
        FREE_NULL(swindow_info[i]);
    return;
}
Esempio n. 4
0
int main() {
	int logi, ch, y, x;

	display_log_type = INFO;
	log_init(&log);
	log_register_message_callback(&log, message_logged);

	current_action = NO_ACTION;

	initscr();
	create_windows();
	cdk_screen = initCDKScreen(log_window);
	log_swindow = newCDKSwindow(cdk_screen, 0, 0, log_lines, log_cols, "", 255, 0, 0);

	draw_stdscr();
	draw_url_input();
	draw_commands();

	select_form();

	raw();
	noecho();
	keypad(stdscr, TRUE);

	while ((ch = wgetch(input_window)) != '' || current_action & CANCEL_SHOWING)
		if (ch == KEY_LEFT)
			form_driver(url_form, REQ_LEFT_CHAR);
		else if (ch == KEY_RIGHT)
			form_driver(url_form, REQ_RIGHT_CHAR);
		else if (ch == KEY_BACKSPACE || ch == 127) {
			getyx(input_window, y, x);

			if (x == FIELD_START + 1) {
				form_driver(url_form, REQ_SCR_HBHALF);
				form_driver(url_form, REQ_END_LINE);
			}

			form_driver(url_form, REQ_LEFT_CHAR);
			form_driver(url_form, REQ_DEL_CHAR);
		} else if (ch == KEY_DC)
			form_driver(url_form, REQ_DEL_CHAR);
		else if (ch == KEY_HOME)
			form_driver(url_form, REQ_BEG_FIELD);
		else if (ch == KEY_END)
			form_driver(url_form, REQ_END_FIELD);
		else if (ch == KEY_UP || ch == KEY_DOWN)
			injectCDKSwindow(log_swindow, ch);
		else if (ch == '')
			cleanCDKSwindow(log_swindow);
		else if (ch == '	')
			change_display_log_type(INFO);
		else if (ch == '')
			change_display_log_type(DETAILS);
		else if (ch == '\n' && current_action & URL_INPUTTING) {
			int ret;

			form_driver(url_form, REQ_END_FIELD);
			form_driver(url_form, 'a');
			form_driver(url_form, REQ_VALIDATION);
			strncpy(url, field_buffer(url_field[0], 0), FIELD_BUF_SIZE);
			url[FIELD_BUF_SIZE - 1] = '\0';
			*strrchr(url, 'a') = '\0';

			http_url_init(&http_url);
			if (ret = http_url_parse(&http_url, url)) {
				char *message;

				switch (ret) {
					case INVALID_SERVER_AUTHORITY:
						message = "Invalid server authority";
						break;
					case INVALID_SCHEME:
						message = "Invalid scheme";
						break;
					case INVALID_PORT:
						message = "Invalid port";
						break;
					default:
						message = "Invalid URI";
						break;
				}

				log_printf(&log, INFO, "http_url_parse", "%s", message);

				draw_url_input();
				draw_commands();
			} else {
				draw_method_selection();
				draw_cancel();
			}
		} else if (tolower(ch) == 'g' && current_action & METHOD_SELECTING) {
			http_init(&http, &http_url, GET, NULL, 0, 3, &log);
			pthread_create(&http_thread, NULL, http_run_thread, &http);
			draw_cancel();
		} else if (tolower(ch) == 'h' && current_action & METHOD_SELECTING) {
			http_init(&http, &http_url, HEAD, NULL, 0, 3, &log);
			pthread_create(&http_thread, NULL, http_run_thread, &http);
			draw_cancel();
		} else if (tolower(ch) == 'p' && current_action & METHOD_SELECTING) {
			draw_post_input();
			draw_cancel();
			select_form();
		} else if (ch == '\n' && current_action & POST_INPUTTING) {
			form_driver(url_form, REQ_END_FIELD);
			form_driver(url_form, 'a');
			form_driver(url_form, REQ_VALIDATION);
			strncpy(post, field_buffer(url_field[0], 0), FIELD_BUF_SIZE);
			post[FIELD_BUF_SIZE - 1] = '\0';
			*strrchr(post, 'a') = '\0';

			http_init(&http, &http_url, POST, post, strlen(post), 3, &log);
			pthread_create(&http_thread, NULL, http_run_thread, &http);
			draw_cancel();
		} else if (ch == '\n' && current_action & FILE_INPUTTING) {
			form_driver(url_form, REQ_END_FIELD);
			form_driver(url_form, 'a');
			form_driver(url_form, REQ_VALIDATION);
			strncpy(file, field_buffer(url_field[0], 0), FIELD_BUF_SIZE);
			file[FIELD_BUF_SIZE - 1] = '\0';
			*strrchr(file, 'a') = '\0';

			pthread_mutex_lock(&input_mutex);
			inputted = 1;
			pthread_cond_broadcast(&input_cond);
			pthread_mutex_unlock(&input_mutex);
		} else if ((ch == 'y' || ch == 'Y') && current_action & OVERWRITE_INPUTTING) {
			do_overwrite = 1;

			pthread_mutex_lock(&input_mutex);
			inputted = 1;
			pthread_cond_broadcast(&input_cond);
			pthread_mutex_unlock(&input_mutex);
		} else if ((ch == 'n' || ch == 'N') && current_action & OVERWRITE_INPUTTING) {
			do_overwrite = 0;
			
			pthread_mutex_lock(&input_mutex);
			inputted = 1;
			pthread_cond_broadcast(&input_cond);
			pthread_mutex_unlock(&input_mutex);
		}else if (ch == '') {
			if (http.status != DISCONNECTED)
				http_disconnect(&http);
			draw_url_input();
			draw_commands();
			select_form();
		} else
			form_driver(url_form, ch);

	delete_input_form();
	destroyCDKSwindow(log_swindow);
	destroyCDKScreen(cdk_screen);
	endwin();

	pthread_mutex_destroy(&input_mutex);
	pthread_cond_destroy(&input_cond);

	return 0;
}
Esempio n. 5
0
int main()
{
	char *mesg[4],*infobuf[2];
	char *shared_memory;
	char string[1024],temp[1024];
	FILE *file;
	Nodeinfo *mynode;
	int segment_id, sem_id, i = 1024, k = 1024, line, j, count;
	void *buf;
	
	signal(SIGTERM, cleanup_handler);
	signal(SIGINT, cleanup_handler);

	req.tv_nsec = 5000000;
	cursesWin = initscr();
	cdkscreen = initCDKScreen(cursesWin);

	initCDKColor();
	sprintf(temp,"<C></B/3>Process Migration - GUI for Statistics and Testing");
	mesg[0] = copyChar(temp);
	title = newCDKLabel(cdkscreen, CENTER, TOP, mesg,1,1,0);
      	setCDKLabel (title, mesg, 1, 1);
      	drawCDKLabel (title, 1);
	freeChar (mesg[0]);

	loadDaemon = newCDKSwindow (cdkscreen, (COLS - 50) * 0.10, (LINES - 12) * 0.40, 12, 50, "<C></B/5>Load Daemon", 1000, 1, 0);
	commsDaemon = newCDKSwindow (cdkscreen, (COLS - 50) * 0.90, (LINES - 12) * 0.40, 12, 50, "<C></B/5>Communication Daemon", 1000, 1, 0);
	migrateDaemon = newCDKSwindow (cdkscreen, (COLS - 50) * 0.10, (LINES - 12) * 0.90, 12, 50, "<C></B/5>Migration Control Daemon", 1000, 1, 0);
	extraInfo = newCDKSwindow (cdkscreen, (COLS - 50) * 0.90, (LINES - 12) * 0.90, 12, 50, "<C></B/5>Information", 1000, 1, 0);


	//setCDKSwindowBackgroundColor(loadDaemon, "</5>");
	//setCDKSwindowBackgroundColor(commsDaemon, "</5>");
	//setCDKSwindowBackgroundColor(migrateDaemon, "</5>");
	//setCDKSwindowBackgroundColor(extraInfo, "</5>");

	file = fopen("/var/log/load","r");
	while(fgets(string, 1025, file) != NULL) {
		substr(&temp[0],&string[0]);
		addCDKSwindow (loadDaemon, temp, BOTTOM);
	}
	fclose(file);
	
	
	file = fopen("/var/log/migrate","r");
	while(fgets(string, 1025, file) != NULL) {
		substr(&temp[0],&string[0]);
		addCDKSwindow (migrateDaemon, temp, BOTTOM);
	}
	fclose(file);
	
	buf = malloc(33);

	file = fopen(INFO_SHM_ID_PATH,"r");
	fgets(string,33,file);
	segment_id = atoi(string);
	fclose(file);

	file = fopen(INFO_SEM_ID_PATH,"r");
	fgets(string,33,file);
	sem_id = atoi(string);
	fclose(file);
	
	info = newCDKLabel(cdkscreen, 0, (LINES - 5) * 0.15, infobuf,3,0,0);
	shared_memory = (void *) shmat(segment_id, 0, 0);
	//setCDKLabelBackgroundColor(info, "</55>");
	refreshCDKScreen(cdkscreen);
	binary_semaphore_post(sem_id);
	cp_loadlog();
	cp_migratelog();
	for(;;) {
		if(i-- == 0) {
			cp_loadlog();
			i = 1024;
		}
		file = popen("diff /tmp/migrate/load.temp /var/log/load | sed 1d | wc -l","r");
		strcpy(string,"\0");
		fgets(string, 1025, file);
		count = atoi(string);
		pclose(file);
		sprintf(string,"count: %d",count);
		if(count != 0) {
			file = popen("diff /tmp/migrate/load.temp /var/log/load | sed 1d","r");
			for(j = 0; j < count; j++) {
				fgets(string, 1025, file);
				substr(&temp[0],&string[0]);
				addCDKSwindow (loadDaemon, temp, BOTTOM);
			}
			pclose(file);
			i = 0;
		}
		/*if(k-- == 0) {
			cp_migratelog();
			k = 1024;
		}
		file = popen("diff /tmp/migrate/migrate.temp /var/log/migrate | sed 1d | wc -l","r");
		strcpy(string,"\0");
		fgets(string, 1025, file);
		count = atoi(string);
		pclose(file);
		sprintf(string,"count: %d",count);
		if(count != 0) {
			file = popen("diff /tmp/migrate/migrate.temp /var/log/migrate | sed 1d","r");
			for(j = 0; j < count; j++) {
				fgets(string, 1025, file);
				substr(&temp[0],&string[0]);
				addCDKSwindow (migrateDaemon, temp, BOTTOM);
			}
			pclose(file);
			k = 0;
		}*/
		binary_semaphore_wait(sem_id);
		memcpy(buf, shared_memory, 33);
		binary_semaphore_post(sem_id);
		mynode = nodeinfo__unpack(NULL, 33, buf);
		if(mynode == NULL) {
			fprintf(stderr,"error unpacking message\n");
			exit(1);
		}
		sprintf(temp,"\t\t\t\t\t\t\t</B/U/7>STATISTICS");
		infobuf[0] = copyChar(temp);
		sprintf(temp,"\t</B>Load:<!B> %0.2f\t</B>No. of peers connected:<!B> %d\t</B>No. of processes migrated:<!B> %d\t</B>No. of processes accepted:<!B> %d\t",mynode->load,mynode->np,mynode->npm,mynode->npa);
		infobuf[1] = copyChar(temp);
		sprintf(temp,"\t\t\t\t</B>Upper Threshold:<!B> %.2f\t</B>Lower Threshold:<!B> %.2f",mynode->uthresh,mynode->lthresh);
		infobuf[2] = copyChar(temp);
		setCDKLabel (info, infobuf, 3, 0);
		drawCDKLabel (info, 0);
		freeChar (infobuf[0]);
		freeChar (infobuf[1]);
		freeChar (infobuf[2]);
		sleep(1);
	}
	exit(0);
}
CCDKSWindow::CCDKSWindow(CDKSCREEN *pScreen, int x, int y, int h, int w, char *title, int slines, bool box,
                         bool shadow) : CBaseCDKWidget(box)
{
    m_pSWindow = newCDKSwindow(pScreen, x, y, h, w, title, slines, box, shadow);
    if (!m_pSWindow) throwerror(false, "Could not create window");
}