Rick Engebretson wrote:
Andy Ball wrote:
Hello Maurice,
ML> CRT in gpc is based on a curses library (ncurses or > PDcurses).
Can gpc's CRT be told to use NetBSD's curses library instead of ncurses or PDcurses? I can install ncurses as a package, but can't help feeling that I shouldn't have to.
The ncurses people (Thomas Dickey now, also maintains xterm) have worked very hard to make ncurses compatible with terminals and curses programs going back to the ice age. Your curses should work.
Well that's backward-compatible. It's possible that CRT uses ncurses features that other curses don't have, and unfortunately I don't have another curses library handy to test (neither the time for it, really).
So, if you want, just try it, and report -- or preferably fix -- any problems you encounter. Most changes will probably affect crtc.h. You can try the crtdemo.pas program which demonstrates many CRT features, so if you get it all to work, that will be a good sign.
However, it's probably less work to just install ncurses. AFAIK, the ncurses people also care about keeping it portable, so while I haven't used it on NetBSD, I wouldn't expect serious problems.
To compile with curses, one must link with the library libcurses. In my older linux distros I think libcurses was merely a link to libncurses (but not anymore). So if gpc's CRT unit does not work with your curses, my guess is that its a linking issue with gpc, and not your curses. (I looked at the CRT unit files but didn't see the linker call.)
For linking, you can change the `{$L}' directive (crt.pas, line ~790). That's the trivial part. Other problems (compile-time and/or runtime) may follow, as I wrote above ...
That being said, the modern console is not your typical terminal, and the gpc CRT unit (and crtdemo with ncurses) goes far beyond putting characters on a screen. Ncurses also provides panels, forms, dialogs, mouse interaction, etc. It is a good program to have on your system.
Sure. :-)
And, BTW, if you're working under X11, you might also want to try PDCurses (aka XCurses) instead. You'll probably have to install it first as well. IME, many xterms and similar don't support function keys etc. very well, so XCurses is sometimes more comfortable. Since XCurses uses the generic X11 libraries in turn, I don't expect portability problems there, either. It can be installed parallel to a terminal curses installation as it calls its libraries and headers differently.
Frank