void input_context::display_help() { // Shamelessly stolen from help.cpp WINDOW *w_help = newwin(FULL_SCREEN_HEIGHT - 2, FULL_SCREEN_WIDTH - 2, 1 + (int)((TERMY > FULL_SCREEN_HEIGHT) ? (TERMY - FULL_SCREEN_HEIGHT) / 2 : 0), 1 + (int)((TERMX > FULL_SCREEN_WIDTH) ? (TERMX - FULL_SCREEN_WIDTH) / 2 : 0)); werase(w_help); // Draw win header and borders draw_border(w_help, c_white); mvwprintz(w_help, 0, (FULL_SCREEN_WIDTH - utf8_width(_("Keybindings"))) / 2 - 1, c_ltred, " %s ", _("Keybindings")); mvwprintz(w_help, 1, 51, c_ltred, _("Unbound keys")); mvwprintz(w_help, 2, 51, c_ltgreen, _("Keybinding active only")); mvwprintz(w_help, 3, 51, c_ltgreen, _("on this screen")); mvwprintz(w_help, 4, 51, c_ltgray, _("Keybinding active globally")); // Clear the lines. Don't touch borders for (int i = 1; i < FULL_SCREEN_HEIGHT - 3; i++) { mvwprintz(w_help, i, 1, c_black, " "); } for (int i = 0; i < registered_actions.size(); i++) { const std::string &action_id = registered_actions[i]; if(action_id == "ANY_INPUT") { continue; } bool overwrite_default; const std::vector<input_event> &input_events = inp_mngr.get_input_for_action(action_id, category, &overwrite_default); nc_color col = input_events.size() ? c_white : c_ltred; mvwprintz(w_help, i, 3, col, "%s: ", inp_mngr.get_action_name(action_id).c_str()); if (!input_events.size()) { mvwprintz(w_help, i, 30, c_ltred, _("Unbound!")); } else { // The color depends on whether this input draws from context-local or from // default settings. Default will be ltgray, overwrite will be ltgreen. col = overwrite_default ? c_ltgreen : c_ltgray; mvwprintz(w_help, i, 30, col, "%s", get_desc(action_id).c_str()); } } wrefresh(w_help); refresh(); long ch = getch(); while (ch != 'q' && ch != 'Q' && ch != KEY_ESCAPE) { ch = getch(); }; werase(w_help); wrefresh(w_help); delwin(w_help); }
int play_game(){ draw_border(); update_position(); draw_snake(); usleep(get_speed()); return 1; }
void run_arrange_hook(void) { SCM arrange_hook_sym = scm_from_locale_symbol("arrange-hook"); if (scm_defined_p(arrange_hook_sym, SCM_UNDEFINED) == SCM_BOOL_T) { scm_c_eval_string("(arrange-hook)"); } else { fallback_arrange(); } client_t *focus_client = get_focus_client(); if (focus_client) { draw_border(focus_client); } else if (client_list) { set_focus_client(client_list); draw_border(client_list); } }
//-----------Splash screens------------// void splash_screen (int screen_type) { switch (screen_type) { case 1 : draw_border(26,3,53,7,1); gotoxy(31,5); textcolor(12); cprintf("Welcome "); textcolor(7); cout<<adm[1].adm_name.first_name; break; case 2 : draw_border(26,3,53,7,1); gotoxy(31,5); textcolor(12); cprintf("Welcome "); textcolor(7); cout<<apt[acc_no].apt_name.first_name; break; case 3 : draw_border(26,3,53,7,1); gotoxy(31,5); textcolor(12); cprintf("Welcome "); textcolor(7); cout<<emp[acc_no].emp_name.first_name; break; case 4 : { clrscr(); draw_border(16,7,63,16,1); gotoxy(19,10); textcolor(12); cprintf("Thank you for using Intellisoft Job Portal"); gotoxy(24,12); textcolor(7); cprintf("Developed by Aniruddha Mysore"); gotoxy(26,13); cprintf("Class 11-B | Roll No. 28"); delay(2000); exit(0); } } }
void live_view::show(const int x, const int y) { if (!enabled || w_live_view == NULL) { return; } bool did_hide = hide(false); // Clear window if it's visible if (!g->u.sees(x, y)) { if (did_hide) { wrefresh(w_live_view); } return; } map &m = g->m; mvwprintz(w_live_view, 0, START_COLUMN, c_white, "< "); wprintz(w_live_view, c_green, _("Mouse View")); wprintz(w_live_view, c_white, " >"); int line = START_LINE; g->print_all_tile_info(x, y, w_live_view, START_COLUMN, line, true); if (m.can_put_items(x, y) && m.sees_some_items(x, y, g->u)) { if(g->u.has_effect("blind")) { mvwprintz(w_live_view, line++, START_COLUMN, c_yellow, _("There's something here, but you can't see what it is.")); } else { print_items(m.i_at(x, y), line); } } #if (defined TILES || defined SDLTILES || defined _WIN32 || defined WINDOWS) // Because of the way the status UI is done, the live view window must // be tall enough to clear the entire height of the viewport below the // status bar. This hack allows the border around the live view box to // be drawn only as big as it needs to be, while still leaving the // window tall enough. Won't work for ncurses in Linux, but that doesn't // currently support the mouse. If and when it does, there'll need to // be a different code path here that works for ncurses. int full_height = w_live_view->height; if (line < w_live_view->height - 1) { w_live_view->height = (line > 11) ? line : 11; } last_height = w_live_view->height; #endif draw_border(w_live_view); #if (defined TILES || defined SDLTILES || defined _WIN32 || defined WINDOWS) w_live_view->height = full_height; #endif inuse = true; wrefresh(w_live_view); }
void snake_game::print_header(WINDOW *w_snake, bool show_shortcut) { draw_border(w_snake); if (show_shortcut) { std::string shortcut = _("<q>uit"); shortcut_print(w_snake, 0, FULL_SCREEN_WIDTH - utf8_width(shortcut.c_str()) - 2, c_white, c_ltgreen, shortcut); } center_print(w_snake, 0, c_white, _("S N A K E")); }
//--------------------------------------------------------------------------------------- void GmoBox::on_draw(Drawer* pDrawer, RenderOptions& opt) { draw_border(pDrawer, opt); draw_shapes(pDrawer, opt); //draw contained boxes std::vector<GmoBox*>::iterator it; for (it=m_childBoxes.begin(); it != m_childBoxes.end(); ++it) (*it)->on_draw(pDrawer, opt); }
void update_frame(const GameState *game) { init_video_buffer(); // Draw puzzle int nr_block = game->nr_block_h * game->nr_block_v; for (int i = 0; i < nr_block; i++) { int block_index = game->block[i]; // Draw a block int scr_x = (i % game->nr_block_h) * game->block_w; int scr_y = (i / game->nr_block_h) * game->block_h; int pic_x = (block_index % game->nr_block_h) * game->block_w; int pic_y = (block_index / game->nr_block_h) * game->block_h; for (int off_y = 0; off_y < game->block_h; off_y++) { for (int off_x = 0; off_x < game->block_w; off_x++) { draw_pixel(scr_x + off_x, scr_y + off_y, get_color(game->image, pic_x + off_x, pic_y + off_y, game->image_w, game->image_h)); } } } // Draw frame for (int i = 0; i < game->nr_block_h + 1; i++) { int scr_x = i * game->block_w; draw_column(scr_x, 0, 6, get_scr_h(), 0); } for (int i = 0; i < game->nr_block_v + 1; i++) { int scr_y = i * game->block_h; draw_row(0, scr_y, 6, get_scr_w(), 0); } draw_border(game->block_x * game->block_w, game->block_y * game->block_h, game->block_w, game->block_h, 3, 0x000000ff); if (game->select == 1) { draw_border(game->select_block_x * game->block_w, game->select_block_y * game->block_h, game->block_w, game->block_h, 3, 0x00ff0000); } update_screen(); }
std::string string_input_popup(std::string title, int width, std::string input, std::string desc, std::string identifier, int max_length, bool only_digits ) { nc_color title_color = c_ltred; nc_color desc_color = c_green; std::vector<std::string> descformatted; int titlesize = utf8_width(title.c_str()); int startx = titlesize + 2; if ( max_length == 0 ) { max_length = width; } int w_height = 3; int iPopupWidth = (width == 0) ? FULL_SCREEN_WIDTH : width + titlesize + 4; if (iPopupWidth > FULL_SCREEN_WIDTH) { iPopupWidth = FULL_SCREEN_WIDTH; } if ( desc.size() > 0 ) { int twidth = utf8_width(desc.c_str()); if ( twidth > iPopupWidth - 4 ) { twidth = iPopupWidth - 4; } descformatted = foldstring(desc, twidth); w_height += descformatted.size(); } int starty = 1 + descformatted.size(); if ( max_length == 0 ) { max_length = 1024; } int w_y = (TERMY - w_height) / 2; int w_x = ((TERMX > iPopupWidth) ? (TERMX - iPopupWidth) / 2 : 0); WINDOW *w = newwin(w_height, iPopupWidth, w_y, ((TERMX > iPopupWidth) ? (TERMX - iPopupWidth) / 2 : 0)); draw_border(w); int endx = iPopupWidth - 3; for( size_t i = 0; i < descformatted.size(); ++i ) { mvwprintz(w, 1 + i, 1, desc_color, "%s", descformatted[i].c_str() ); } mvwprintz(w, starty, 1, title_color, "%s", title.c_str() ); long key = 0; int pos = -1; std::string ret = string_input_win(w, input, max_length, startx, starty, endx, true, key, pos, identifier, w_x, w_y, true, only_digits); werase(w); wrefresh(w); delwin(w); refresh(); return ret; }
long popup(const std::string &text, PopupFlags flags) { int width = 0; int height = 2; std::vector<std::string> folded = foldstring(text, FULL_SCREEN_WIDTH - 2); height += folded.size(); for( size_t i = 0; i < folded.size(); ++i ) { int cw = utf8_width(folded[i].c_str()); if(cw > width) { width = cw; } } width += 2; WINDOW *w; if ((flags & PF_FULLSCREEN) != 0) { w = newwin(FULL_SCREEN_HEIGHT, FULL_SCREEN_WIDTH, (TERMY > FULL_SCREEN_HEIGHT) ? (TERMY - FULL_SCREEN_HEIGHT) / 2 : 0, (TERMX > FULL_SCREEN_WIDTH) ? (TERMX - FULL_SCREEN_WIDTH) / 2 : 0); } else if ((flags & PF_ON_TOP) == 0) { if (height > FULL_SCREEN_HEIGHT) { height = FULL_SCREEN_HEIGHT; } w = newwin(height, width, (TERMY - (height + 1)) / 2, (TERMX > width) ? (TERMX - width) / 2 : 0); } else { w = newwin(height, width, 0, (TERMX > width) ? (TERMX - width) / 2 : 0); } draw_border(w); for( size_t i = 0; i < folded.size(); ++i ) { mvwprintz(w, i + 1, 1, c_white, "%s", folded[i].c_str()); } long ch = 0; // Don't wait if not required. while((flags & PF_NO_WAIT) == 0) { wrefresh(w); ch = getch(); if ((flags & PF_GET_KEY) != 0) { // return the first key that got pressed. werase(w); break; } if (ch == ' ' || ch == '\n' || ch == KEY_ESCAPE) { // The usuall "escape menu/window" keys. werase(w); break; } } wrefresh(w); delwin(w); refresh(); return ch; }
//---------Edit Applicant Profile----------// void edit_apl_profile() { int i = acc_no; char choice; clrscr; gotoxy(28,10); textcolor(12); cprintf("What would you like to edit? "); textcolor(7); cout<<"\n\t\t\t\t[1] Name\n\t\t\t\t[2] Industry\n\t\t\t\t[3] Username"; draw_border(25,8,59,16,0); gotoxy(28,15); cin>>choice; clrscr(); switch (choice) { case '1' : { gotoxy(24,11); cout<<"Please enter your first name : "; cin>>apt[i].apt_name.first_name; cin.ignore(); gotoxy(24,12); cout<<"Please enter your last name : "; cin>>apt[i].apt_name.last_name; cin.ignore(); break; } case '2' : { gotoxy(27,11); cout<<"Industry 1 : "; cin>>apt[i].industry[1]; cin.ignore(); gotoxy(27,12); cout<<"Industry 2 : "; cin>>apt[i].industry[2]; gotoxy(27,13); cin.ignore(); cout<<"Industry 3 : "; cin>>apt[i].industry[3]; cin.ignore(); break; } case '3' : { gotoxy(28,12); cout<<"Username : "; cin>>apt[i].username; cin.ignore(); break; } default : error(1); } }
void start_graph(void) { initscr(); raw(); color_init(); curs_set(0); cbreak(); noecho(); nodelay(stdscr, TRUE); scrollok(stdscr, TRUE); draw_border(); }
void Ncurses::display(std::list<t_snake> snake, const t_food food) { wclear(_game); draw_border(); for_each(snake.begin(), snake.end(), bind1st(std::mem_fun(&Ncurses::snake_body), this)); snake_head(snake.begin()->x, snake.begin()->y); wattron(_game, COLOR_PAIR(1)); mvwprintw(_game, food.y + 1, food.x + 1, "@"); wattroff(_game, COLOR_PAIR(1)); speedup(snake.begin()->x, snake.begin()->y, food.x, food.y); wrefresh(_game); }
//---------Password Check----------// int credential_input (int acc) { int i,j; char u[20],p[20]; draw_border(23,8,59,14,0); gotoxy(26,10); cout<<"Enter username : "******"Enter password : "******"*"; } p[j-1]='\0'; if (acc ==1) for(i=0; i<5; i++) { if(strcmp(u,adm[0].username)==0 && strcmp(p,adm[0].password)==0) { clrscr(); return 1; } } else if (acc==2) for(i=0; i<20 ; i++) { if(strcmp(u,apt[i].username)==0 && strcmp(p,apt[i].password)==0) { clrscr(); acc_no=i; return 2; } } else if (acc==3) for(i=0; i<10 ; i++) { if(strcmp(u,emp[i].username)==0 && strcmp(p,emp[i].password)==0) { clrscr(); acc_no=i; return 3; } } return 0; }
static void lem_redraw(dcpu *dcpu) { draw_border(); if (term.vram) { // don't perform the indirection outside the loop. vid ram can be mapped // toward the high end of the range, in which case we need to be careful // that it wraps around to the start. u16 addr = term.vram; for (u16 i = 0; i < SCR_HEIGHT; i++) for (u16 j = 0; j < SCR_WIDTH; j++) draw(dcpu->ram[addr++], i, j); } wrefresh(term.vidwin); }
// redraw the whole screen void redraw_game(GAME *game) { // redraw the main window (containg the border and stuff) clear(); draw_border(game); redrawwin(stdscr); refresh(); // redraw the fruits redraw_fruits(&game->fruits); // redraw the snake redraw_snake(&game->snake); }
static void render(void) { mdarea_t *lv; draw_border(); for (lv = world.hvarea; lv; lv = lv->next) { draw_varea(lv); } for (lv = world.hvarea; lv; lv = lv->next) { mdnode_t *ln; for (ln = lv->hnode; ln; ln = ln->next) { draw_node(ln); } } }
static void paint(HWND hwnd) { HDC dc; PAINTSTRUCT paints; if (!(dc=BeginPaint(hwnd,&paints))) return; EnterCriticalSection(&vt_mutex); draw_vt(dc, paints.rcPaint.right, paints.rcPaint.bottom, vt); draw_border(dc, vt); LeaveCriticalSection(&vt_mutex); EndPaint(hwnd,&paints); }
void draw_stats(frame *frm, FILE *urandom){ //TODO expand draw_stats WINDOW *w_stats; PANEL *p_stats; int size_x=30, size_y=10; w_stats = newwin(size_y, size_x, (frm->centerY)-(size_y/2), (frm->centerX)-(size_x/2)); wclear(w_stats); draw_border(w_stats); p_stats = new_panel(w_stats); update_panels(); //order doupdate(); //show do_exit(urandom); }
void button_draw(int x1,int y1,int x2,int y2,OBJREC *o) { CTL3D x; char w; bar(x1,y1,x2,y2); highlight(&x,o->color); w=*(char *)o->data; x.bsize=2-w; x.ctldef=(w<<1)+w; draw_border(x1+2,y1+2,x2-x1-4,y2-y1-4,&x); set_aligned_position(((x1+x2)>>1)+(w<<1),((y1+y2)>>1)+(w<<1),1,1,(char *)o->userptr); outtext((char *)o->userptr); }
/** @brief Renders a dialog. * * Renders a dialog in a specific style and at a specific position. * * @param menu The dialog to render. * @param style The style to render in. * @param pos The position to render at. */ void gg_dialog_render(gg_dialog_t *dialog, int active) { gg_dialog_style_t *style = &dialog->style; gg_widget_t *child = gg_bin_get_child(GG_BIN(dialog)); int size = 0; gg_rect_t area; int xmin, xmax, ymin, ymax; if (dialog->flags & GG_DIALOG_HIDDEN) return; gg_dialog_get_screen_pos(dialog, &xmin, &ymin); xmax = (xmin + dialog->width); ymax = (ymin + dialog->height); /* Draw the 'fade' */ gg_system_draw_filled_rect(0, 0, 640, 480, &style->fade_col); if (style->textured) gg_system_get_image_size(style->border.image[0], &size, NULL); xmin += size; xmax -= size; ymin += size; ymax -= size; area.x = xmin; area.y = ymin; area.width = xmax - xmin; area.height = ymax - ymin; if (dialog_in_trans) area.height *= dialog_get_transition(); if (style->textured) draw_border(style->border.image, dialog->title, active, area, size); xmin += style->hor_pad; xmax -= style->hor_pad; ymin += style->vert_pad; ymax -= style->vert_pad; if (!dialog_in_trans) child->render(child, xmin, ymin, active); dialog_get_transition(); }
void logo(void) { CTL3D ctl; word *p; ctl.light = RGB555(31,31,31); ctl.shadow = RGB555(16,16,16); ctl.bsize = 2; ctl.ctldef = 0; draw_border(120,120,0x18f,0x6a,&ctl); p = (word *)LoadResourceFont("MAPEDIT.HI"); put_picture(120,120,p); // free(p); showview(0,0,0,0); }
void main_menu::display_credits() { // AStyle got this redundant indent catacurses::window w_credits_border = catacurses::newwin( FULL_SCREEN_HEIGHT, FULL_SCREEN_WIDTH, ( TERMY > FULL_SCREEN_HEIGHT ) ? ( TERMY - FULL_SCREEN_HEIGHT ) / 2 : 0, ( TERMX > FULL_SCREEN_WIDTH ) ? ( TERMX - FULL_SCREEN_WIDTH ) / 2 : 0 ); catacurses::window w_credits = catacurses::newwin( FULL_SCREEN_HEIGHT - 2, FULL_SCREEN_WIDTH - 2, 1 + ( int )( ( TERMY > FULL_SCREEN_HEIGHT ) ? ( TERMY - FULL_SCREEN_HEIGHT ) / 2 : 0 ), 1 + ( int )( ( TERMX > FULL_SCREEN_WIDTH ) ? ( TERMX - FULL_SCREEN_WIDTH ) / 2 : 0 ) ); draw_border( w_credits_border, BORDER_COLOR, _( " CREDITS " ) ); wrefresh( w_credits_border ); catacurses::refresh(); multipage( w_credits, mmenu_credits ); catacurses::refresh(); }
/* funkcja rysuje ramke wokol matriksu */ void draw_matrix_border(const struct position *p) { SDL_Rect r; Uint32 c; /* TOOD: konfigurowalny kolor zrobic */ c = SDL_MapRGB(screen->format, 0xfd, 0xf9, 0x0c); r.x = p->x; r.y = p->y; r.w = p->size * MATRIX_WIDTH; r.h = p->size * MATRIX_HEIGHT; draw_border(bground, r, BORDER, c); /* Teraz ramka wokol podgladu klocka */ r.x = p->x2; r.w = p->size * PREVIEW_W; r.y = p->y2; r.h = p->size * PREVIEW_H; draw_border(bground, r, BORDER, c); SDL_BlitSurface(bground, NULL, screen, NULL); SDL_Flip(screen); }
void draw_grid( WINDOW *w, const int list_width ) { draw_border( w ); mvwprintz( w, 0, 2, c_ltred, _( " Construction " ) ); // draw internal lines mvwvline( w, 1, list_width, LINE_XOXO, getmaxy( w ) - 2 ); mvwhline( w, 2, 1, LINE_OXOX, list_width ); // draw intersections mvwputch( w, 0, list_width, c_ltgray, LINE_OXXX ); mvwputch( w, getmaxy( w ) - 1, list_width, c_ltgray, LINE_XXOX ); mvwputch( w, 2, 0, c_ltgray, LINE_XXXO ); mvwputch( w, 2, list_width, c_ltgray, LINE_XOXX ); wrefresh( w ); }
void update_colors_in(node_t *n, desktop_t *d, monitor_t *m) { if (n == NULL) { return; } else { if (n->presel != NULL) { uint32_t pxl = get_color_pixel(presel_feedback_color); xcb_change_window_attributes(dpy, n->presel->feedback, XCB_CW_BACK_PIXEL, &pxl); if (d == m->desk) { /* hack to induce back pixel refresh */ window_hide(n->presel->feedback); window_show(n->presel->feedback); } } if (n == d->focus) { draw_border(n, true, (m == mon)); } else if (n->client != NULL) { draw_border(n, false, (m == mon)); } else { update_colors_in(n->first_child, d, m); update_colors_in(n->second_child, d, m); } } }
/*-----------------------------------------------------------------*/ int employer() { employer_validation(); char choice; splash_screen(3); delay(2000); do { clrscr(); gotoxy(29,5); textcolor(12); cprintf("Please enter your option : "); textcolor(7); cout<<"\n\n\t\t\t[1] View employer profile\n\n\t\t\t[2] Edit profile\n\n\t\t\t[3] View applicant list \n\n\t\t\t[4] Applicant search\n\n\t\t\t[5] Logout\n\n\t\t\t[6] Exit"; draw_border(23,3,55,19,0); gotoxy(29,21); cin>>choice; cin.ignore(); switch (choice) { case '1' : clrscr(); view_employer_profile(); break; case '2' : cout<<"Taking you to profile...."; delay(500); clrscr(); view_employer_profile(); break; case '3' : clrscr(); applicant_list(); break; case '4' : clrscr(); applicant_search(); break; case '5' : break; case '6' : splash_screen(4); default : error(1); break; } } while (choice!='5'); return 0; }
static SCM scm_draw_border(SCM client_smob, SCM color, SCM width) { client_t *client = (client_t *)SCM_SMOB_DATA(client_smob); uint32_t color_uint; int width_int; if (scm_is_integer(color)) color_uint = scm_to_uint32(color); else color_uint = 0x6CA0A3; if (scm_is_integer(width)) width_int = scm_to_int(width); else width_int = 1; draw_border(client, color_uint, width_int); return SCM_UNSPECIFIED; }
void main_menu::display_credits() { // astyle got this redundant indent WINDOW *w_credits_border = newwin( FULL_SCREEN_HEIGHT, FULL_SCREEN_WIDTH, ( TERMY > FULL_SCREEN_HEIGHT ) ? ( TERMY - FULL_SCREEN_HEIGHT ) / 2 : 0, ( TERMX > FULL_SCREEN_WIDTH ) ? ( TERMX - FULL_SCREEN_WIDTH ) / 2 : 0 ); WINDOW *w_credits = newwin( FULL_SCREEN_HEIGHT - 2, FULL_SCREEN_WIDTH - 2, 1 + ( int )( ( TERMY > FULL_SCREEN_HEIGHT ) ? ( TERMY - FULL_SCREEN_HEIGHT ) / 2 : 0 ), 1 + ( int )( ( TERMX > FULL_SCREEN_WIDTH ) ? ( TERMX - FULL_SCREEN_WIDTH ) / 2 : 0 ) ); draw_border( w_credits_border, BORDER_COLOR, _( " CREDITS " ) ); wrefresh( w_credits_border ); refresh(); multipage( w_credits, mmenu_credits ); delwin( w_credits ); delwin( w_credits_border ); refresh(); }
WINDOW* prep_game(WINDOW *w_game, WINDOW *w_gamefrm, PANEL *p_game, PANEL *p_gamefrm, frame *game, frame *term, int *xPos, int *yPos, snake *snake){ if(term->lines > MAX_Y) game->lines = MAX_Y; //consider border! else game->lines = term->lines; //leave space for messages if(term->cols > MAX_X) game->cols = MAX_X; //consider border! else game->cols = term->cols; //calc center game->centerY = (game->lines)/2; game->centerX = (game->cols)/2; //create window in center w_game = newwin(game->lines, game->cols, //size (term->centerY)-(game->centerY), //posY (term->centerX)-game->centerX); //posX w_gamefrm = newwin((game->lines)+2, (game->cols)+2, (term->centerY)-(game->centerY)-1, (term->centerX)-(game->centerX)-1); draw_border(w_gamefrm); /* Stack Panels on top of each other w/p_game is on top*/ p_gamefrm = new_panel(w_gamefrm); p_game = new_panel(w_game); update_panels(); // update order of panels | IMPORTANT: only after all wins are inited doupdate(); //show updated panels //move cursor to center *xPos=game->centerX; *yPos=game->centerY; //invalidate lastPos snake->lastPos_h[0] = -1; snake->lastPos_h[1] = -1; snake->lastPos_t[0] = -1; snake->lastPos_t[1] = -1; do_refresh(w_game, xPos, yPos, NULL, snake); /* :::::WARNING::::: * dragons ahead: the panel functions change the pointing destination of w_game * you have to reset it in main, else you'll spend many hours of debugging not noticing that * all stuff gets written in foreign address space! */ return w_game; }