Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.
Using PDCurses 3.3 on Unbuntu 7.10, I ran the "testcurs" procedure. Under OUTPUT, it failed to show blinking characters at that point of the test.
X11 R6, PDCurses 3.3, Ubuntu 7.04 running under gnome..
The ptest fails to blink. This might be causing an error under the X11 version of THE.
I am not going to drop it here unless the maintainer of PDCurses is interested in tracking this down.
You may have to wait a while bro,
this forum is real slow and if I was maintainer I'd only check it at the end of the month.
But its worth it in it
I check it more often than that.
Blinking does not work in the X11 port, period. It doesn't work most of the time in most other ports, either. Instead, the A_BLINK attribute is used as a synomym for "bright background". You can *try* to change this by calling "PDC_set_blink(TRUE)", which will turn real blink mode on, if possible (and set COLORS from 16 back to 8). Usually it won't work.
I would be very surprised if this had anything to do with any problems you're seeing in THE, although I would not be surprised that you're seeing problems.
Perhaps I should elaborate...
It doesn't work at all in X11, SDL, or Win32, and never has. It works in DOS and OS/2 in some circumstances, mainly when you're using a real text mode (not running in a window). I could also make it work in X11 and SDL, but 1) there'd be a huge overhead -- all the blinking cells would have to be redrawn every blink interval, 2) there's already (unfortunately) an established custom of using A_BLINK when you want a bright background, and 3) I really don't like blinking, so I lack the motivation. (I do recognize that it's part of what curses is theoretically supposed to do, so my lack of motivation doesn't rule it out, just pushes it to the lowest priority.)
So in 3.0, I made this change, as described in HISTORY:
- COLORS, which had been fixed at 8, is now either 8 or 16, depending on
the terminal -- usually 16. When it's 8, blinking mode is enabled
(controlled as before by the A_BLINK attribute); when it's 16, bright
background colors are used instead. On platforms where it can be
changed, the mode is toggled by the new function PDC_set_blink().
PDCurses tries to set PDC_set_blink(FALSE) at startup. (In Win32, it's
always set to FALSE; in DOS, with other than an EGA or VGA card, it
can't be.) Also, COLORS is now set to 0 until start_color() is called.
The point here wasn't really to change things, but to recognize existing practice, and to allow direct access to all 16 colors without the kludgy use of A_BLINK and A_BOLD.
Now, as it happens, COLORS == 16 did cause a problem with THE, although this is only tangentially related to the issue of blinking. Some of the THE code was written with an implicit assumption that COLORS == 8. This was something I discussed with Mark in May, and sent him a fix. (BTW, if you doubt that it's a THE problem, try building it against ncurses and running it in an xterm with term set to "xterm-88color".)
PDCurses 3.3 caused a new problem with THE, regarding cursor positioning, for which I again sent a patch to Mark.
I see that the latest version of THE from SourceForge is from November 2006, so it won't include these changes. You may have to use PDCurses 2.8 until THE is updated.
Or, I could just post my patches.
--- the.c.orig 2007-05-28 02:36:32.000000000 -0400
+++ the.c 2007-05-28 02:42:45.000000000 -0400
@@ -1257,13 +1257,17 @@
- short fg=0,bg=0;
+ short fg=0,bg=0,maxcol;
- for (fg=0;fg<COLORS;fg++)
+ maxcol = COLORS;
+ if (maxcol > 8)
+ maxcol = 8;
+ for (fg=0;fg<maxcol;fg++)
- for (bg=0;bg<COLORS;bg++)
+ for (bg=0;bg<maxcol;bg++)
if (ATTR2PAIR(fg,bg) <= COLOR_PAIRS)
--- getch.c.org 2007-05-29 18:25:27.000000000 -0400
+++ getch.c 2007-07-12 13:43:15.000000000 -0400
@@ -83,6 +83,10 @@
short state = NORMAL;
short fkeycount = 0;
+ keypad( winptr, TRUE );
--- edit.c.org 2007-07-12 13:29:27.000000000 -0400
+++ edit.c 2007-07-12 13:38:44.000000000 -0400
@@ -121,7 +121,7 @@
if (key == (-1))
- key = my_getch(stdscr);
+ key = my_getch(CURRENT_WINDOW);
#if defined(PDCURSES_MOUSE_ENABLED) || defined(NCURSES_MOUSE_VERSION)
if (key == KEY_MOUSE)
Thanks for the response.
I'll try it to see if it has some effect.
Sorry about the lack of indentation, but you get the idea.