LINUX.ORG.RU

ncurses trable !


0

0

void paint_box (WINDOW *win_paint ,char paint_ch ,int st_posx ,int st_posy ,int end_posx ,int end_posy) {

int s_posy = st_posy;

while (st_posx != end_posx) {

while (st_posy != end_posy) {

mvwaddch (win_paint ,st_posx ,st_posy ,paint_ch);
usleep (1000);
st_posy++;
}

wrefresh (win_paint);
st_posy = s_posy;
st_posx++;
}
}


вот эта функция делает заливку окна но когда идет печать символов всё мигает
что не так и почему мигает ?????


поясню эти символы типа прямоугольник залитый или на половину залитый если использовать обычные символы например '#' то всё ok

swop
() автор топика

#include <signal.h>
#include <curses.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>


void finish (int sig_no) {
endwin ();
exit (0);
}

void print_err_w (WINDOW *err_win ,char *type_err ,int *s_posy ,int *s_posx) {

int static new_pos = 10;

mvwaddstr (err_win ,new_pos++ ,1 ,type_err);
wrefresh (err_win);
wmove (err_win ,*s_posy ,*s_posx);

}

void logo_animate (WINDOW *main_win ,int st_posx ,int st_posy) {
int i = 0;

while (i != 30 ) {

(mvwaddch (main_win ,--st_posy ,st_posx ,129)==OK) ? : print_err_w (main_win ,"mvwaddch ()" ,&st_posy ,&st_posx);
(wrefresh (main_win)==OK) ? : print_err_w (main_win ,"wrefresh ()" ,&st_posy ,&st_posx);
(mvwaddch (main_win ,--st_posy ,st_posx ,130)==OK) ? : print_err_w (main_win ,"mvwaddch ()" ,&st_posy ,&st_posx);
(wrefresh (main_win)==OK) ? : print_err_w (main_win ,"wrefresh ()" ,&st_posy ,&st_posx);
(mvwaddch (main_win ,st_posy ,++st_posx ,128)==OK) ? : print_err_w (main_win ,"mvwaddch ()" ,&st_posy ,&st_posx);
(wrefresh (main_win)==OK) ? : print_err_w (main_win ,"wrefresh ()" ,&st_posy ,&st_posx);
(mvwaddch (main_win ,st_posy ,++st_posx,131)==OK) ? : print_err_w (main_win ,"mvwaddch ()" ,&st_posy ,&st_posx);
(wrefresh (main_win)==OK) ? : print_err_w (main_win ,"wrefresh ()" ,&st_posy ,&st_posx);
(mvwaddch (main_win ,++st_posy ,st_posx,129)==OK) ? : print_err_w (main_win ,"mvwaddch ()" ,&st_posy ,&st_posx);
(wrefresh (main_win)==OK) ? : print_err_w (main_win ,"wrefresh ()" ,&st_posy ,&st_posx);
(mvwaddch (main_win ,++st_posy ,st_posx,132)==OK) ? : print_err_w (main_win ,"mvwaddch ()" ,&st_posy ,&st_posx);
(wrefresh (main_win)==OK) ? : print_err_w (main_win ,"wrefresh ()" ,&st_posy ,&st_posx);
(mvwaddch (main_win ,st_posy ,++st_posx,133)==OK) ? : print_err_w (main_win ,"mvwaddch ()" ,&st_posy ,&st_posx);
(wrefresh (main_win)==OK) ? : print_err_w (main_win ,"wrefresh ()" ,&st_posy ,&st_posx);

i++;
}
}

int main (int argc ,char *argv[]) {
int num = 0;
char *msg = "hello !!!";

WINDOW *mainwin;

signal (SIGINT ,finish);

initscr ();
keypad (stdscr ,TRUE);
nonl ();
cbreak ();
echo ();
curs_set (0);

mainwin = newwin (0 ,0 ,0 ,0);
box (mainwin ,129 ,128);
wrefresh (mainwin);
logo_animate (mainwin ,3 ,3);

sleep (100);
finish (0);
return 0;
}


пытаемся нарисовать зигзаг на 8 цикле портится геометрия ошибок нет всё это смотрю в терминале под KDE в ЧЕМ ПРОБЛЕМА ????? :((((( задолбался уже бред какойто

swop
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.