On 2005-09-19, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > can someone provide an example of a curses application that works in a > xterm that can be resized?
I'm afraid I can't post the entire program, but what you need to do is to catch the WINCH signal and set a flag which is checked by your main "event" loop and handled. Here's the basic C code: static void sigwinchHandler(int sig) { (void) sig; sigwinchReceived = 1; } static void clipWindows(void) { tCh *ch; int x,y,rows,cols; for (ch = chlist; ch != NULL; ch = ch->next) { getbegyx(ch->win,y,x); getmaxyx(ch->win,rows,cols); clipwin(&rows,&cols,&y,&x); moveWindow(ch,rows,cols,y,x); } } main() { [...] sigact.sa_handler = sigwinchHandler; s = sigaction(SIGWINCH, &sigact, NULL); assert(s==0); // start up curses while (1) { // do stuff if (sigwinchReceived) { struct winsize size; if (ioctl(fileno(stdout), TIOCGWINSZ, &size) == 0) { resizeterm(size.ws_row, size.ws_col); clipWindows(); } sigwinchReceived = 0; } } } -- Grant Edwards grante Yow! If I am elected no at one will ever have to do visi.com their laundry again! -- http://mail.python.org/mailman/listinfo/python-list