[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Ncurses flickering.
From: |
Brendan inglese |
Subject: |
Ncurses flickering. |
Date: |
Fri, 22 Nov 2002 09:53:49 +1100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021018 |
Hi , sorry about my last message, mozilla plays games with me :-/
I know this may be a bit off topic, but ive been messaging newsgropus
and lots of places but to no avail so i come here in a final bid to
get my answer, im using linux(2.4.10 , slackware 8)
and FreeBSD 4.3 , the freebsd meachine runs my program, but does not
flicker,
but the linux one runs it and it flickers every time the screen is
refreshed , the entire screen
flickers even though that only one (small) window is refreshed :-(
the freebsd terminal type is 'cons25', and on linux ive tryed 'xterm'
and 'linux', and 'vt100'.
how can i elminiante this unwanted flickering, thanks :-)
---
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <ncurses.h>
#define IMPUT_WINDOW_SIZE 1
#define STATUS_WINDOW_SIZE 1
struct _window{
WINDOW *window;
int x;
int y;
int max_x;
int max_y;
int x_end;
int y_end;
};
int main()
{
int i = 0;
int max_x,max_y;
struct _window display;
struct _window status;
struct _window imput;
memset(&display,0,sizeof(struct _window));
memset(&status,0,sizeof(struct _window));
memset(&imput,0,sizeof(struct _window));
initscr();
getmaxyx(stdscr,max_y,max_x);
display.y_end = max_y - IMPUT_WINDOW_SIZE - STATUS_WINDOW_SIZE;
status.y_end = display.y_end + STATUS_WINDOW_SIZE;
imput.y_end = display.y_end + STATUS_WINDOW_SIZE + IMPUT_WINDOW_SIZE;
display.window = newwin(display.y_end,max_x,0,0);
status.window = newwin(STATUS_WINDOW_SIZE,max_x,display.y_end,0);
imput.window = newwin(IMPUT_WINDOW_SIZE,max_x,status.y_end,0);
getch();
while (i < (display.y_end))
{
getyx(display.window,display.y,display.x);
mvwprintw(display.window,i++,0,"%i Hello world! %i
%i",i,display.y,display.x);
}
wrefresh(display.window);
getch();
wprintw(status.window,"Status hello w0rrld!");
wrefresh(status.window);
getch();
wclear(status.window);
wmove(status.window,0,0);
wprintw(status.window,"Status hello world number two!");
wrefresh(status.window);
getch();
wmove(status.window,0,0);
wclear(status.window);
wprintw(status.window,"And finally, Status hello world #3");
wrefresh(status.window);
getch();
wmove(imput.window,0,0);
wprintw(imput.window,"display,%i status,%i imput,%i :: MY %i",
display.y_end,
status.y_end,
imput.y_end,
max_y);
wrefresh(imput.window);
getch();
delwin(display.window);
delwin(status.window);
delwin(imput.window);
endwin();
return 0;
}
---
thanks ;-)