S
sirix
Hi,
I'm using g++ 4.1.2 and ncurses 5.6.
Following simple code correctly displays dimensions of an xterm while one
resizes it's window. I thought that uncommenting wouldn't change anything
in a behaviour of this program. However, it does change - on execution
program correctly displays xterm dimensions, but after changing size of a
window it still shows old dimensions.
What should I think about it?
---
#include <ncurses.h>
#include <iostream.h>
#include <signal.h>
void handler(int sig){};
main() {
// signal(SIGWINCH,handler);
initscr();
int X,Y;
char msg[10];
for(;{
getmaxyx(stdscr,Y,X);
clear();
sprintf(msg,"%d, %d",X,Y);
addstr(msg);
refresh();
usleep(400);
}
}
---
I'm using g++ 4.1.2 and ncurses 5.6.
Following simple code correctly displays dimensions of an xterm while one
resizes it's window. I thought that uncommenting wouldn't change anything
in a behaviour of this program. However, it does change - on execution
program correctly displays xterm dimensions, but after changing size of a
window it still shows old dimensions.
What should I think about it?
---
#include <ncurses.h>
#include <iostream.h>
#include <signal.h>
void handler(int sig){};
main() {
// signal(SIGWINCH,handler);
initscr();
int X,Y;
char msg[10];
for(;{
getmaxyx(stdscr,Y,X);
clear();
sprintf(msg,"%d, %d",X,Y);
addstr(msg);
refresh();
usleep(400);
}
}
---