I am seeing "strange" behaviour when trying to grab user input within Curses v1.32.
I have created a small window and put some text in it, then drawn a box around the window - this works fine until I add the code to get input from the user, after which the box is no longer drawn.
I have seen this on Debian Jessie, Debian Lenny and RHEL-6.
Below is a small code example displaying this behaviour. If you run this code without args a box is drawn around the window. Provide an arg to the script so user input is sought and the box is no longer drawn around the window.
Any Curses guru's shed any light on this for me?
#!/usr/bin/perl use strict; use warnings; use Curses; END{ endwin(); }; initscr; curs_set(0); clear(); noecho(); halfdelay(30); my $win1 = Curses->new( 7, 30, 5, 5); $win1->box(ACS_VLINE, ACS_HLINE); my $char = -1; while(1) { $win1->addstr( 2, 2, scalar(localtime)); $win1->addstr( 4, 10, "Char: $char "); $win1->refresh; if(!@ARGV) { sleep 3; } else { $char = getch(); } }
Thanks
Duncs
In reply to Strange Curses behaviour by duncs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |