On 2009-03-05 22:05, Dennis Peterson wrote:
> Török Edwin wrote:
>
>> On 2009-03-05 21:33, Dennis Peterson wrote:
>>
>>> The current version does not respond to a window resize signal so if you
>>> reduce
>>> the window size some of the data fields are lost.
>>>
>>> I'm running it from a local Xterm ssh'd into the server.
>>>
>>>
>> What OS are you running the xterm on? What version of ncurses did you use?
>>
>> I tried ssh-ing to a Solaris box, from a Linux box, and resize worked
>> fine (ncurses 5.6.20061217).
>> Also ncurses 5.7 works on Linux.
>>
>
>
> The Xterm is running in OS X's X11. The version of ncursed I built it with is
> 5.4. Anecdotal info: The top program I built is 3.6.1 built with the same
> version of ncurses and it resized fine.
>
> Updating ncurses involves a lot of regression testing with existing
> applications
> and perhaps rebuilding some or all of then and I don't care to do that until
> I
> do a server refresh later this year so I'm stuck with 5.4 for now.
>
Hi Dennis,
Try compiling the testprogram below, and then resize the window.
On ncurses-5.4 if I shrink the window it keeps giving me the old size,
enlarging the window works.
With ncurses versions 5.5, 5.6, 5.7 all is ok.
If I remove the line with subwin, it works with 5.4 too. I think this is
an ncurses 5.4 bug.
/* ncurses resize test, compile with:
* gcc `ncurses5-config --cflags` ncursestest.c `ncurses5-config --libs`
-o ncursestest
* If you don't have ncurses5-config try:
* gcc ncursestest.c -o ncursestest -lncurses
*/
#include <ncurses.h>
static void cleanup(void)
{
endwin();
}
int main()
{
unsigned maxy, maxx;
int ch;
WINDOW *win;
initscr();
atexit(cleanup);
keypad(stdscr, TRUE);
nonl();
halfdelay(20);
noecho();
curs_set(0);
getmaxyx(stdscr, maxy, maxx);
touchwin(stdscr);
werase(stdscr);
refresh();
win = subwin(stdscr, 0, maxx-1, maxy-1, 0);
do {
if (ch == KEY_RESIZE) {
getmaxyx(stdscr, maxy, maxx);
endwin();
refresh();
delwin(win);
getmaxyx(stdscr, maxy, maxx);
win = subwin(stdscr, 0, maxx-1, maxy-1, 0);
touchwin(stdscr);
werase(stdscr);
refresh();
}
mvwprintw(stdscr, 0, 0, "%u x %u", maxx, maxy);
refresh();
} while(toupper(ch = getch()) != 'Q');
return 0;
}
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml