Mail Archives: djgpp/1998/12/20/23:20:47
Thanks for everyone that answered my quest for Curses experience with
DJGPP and Linux. I'd like to summarize what i read and what i
decided about this to the newsgroup.
As Boon van der RJ <rjvdboon AT cs DOT vu DOT nl> commented, the curses for
DJGPP is PDCurses 2.3, available at
ftp://ftp.lightlink.com/pub/hessling/PDCurses/
(Version 2.2 is provided in DJGPP package.) PDCurses is a public domain
-- not GPL --, port of curses to MS-DOS, Win32 and X11. The use of curses
looks like a good way of writing portable apps that do character-based
screen management. That means one can use better user interfaces than
the ones provided by getch(), puts(). :-)
Linux implementation of curses, called NCurses was not ported to
DJGPP.
Dave Cook <davecook AT home DOT com> suggests the use of S-Lang, or
slang, instead of curses. He comments that slang has less features
than curses, but can be easier to port. It is based at
http://space.mit.edu/~davis/slang.html
I took a look at it and it is very interesting: you can write your
screen management apps in an interpreted macro language that looks a lot
like C! And it was ported to Unix/Linux, MS-DOS, VMS and OS/2!!!
Canonical apps developed with slang are jed (a text editor) and slrn
(a variant of the Unix newsreader called rn).
A more recently developed app using slang is mc, GNU's Midnight
Commander, a file manager for Unix, ported to DJGPP by bowman
<bowman AT montana DOT com>. He comments that some widgets, what MS-Win
people call controls, can be found in mc's code, in GNOME's site, at
http://www.gnome.org
Dave Cook <davecook AT home DOT com> also suggested a site called Curses
Development Kit (CDK), at
http://www.datasoft.on.ca/~cdk/
I've taken a look at it and it looks very nice: the library creates
widgets / controls using a modular approach like the one used with
the FILE structure and fopen(), fclose() etc. That is: a
centralized structure that is not accessed directly, but through
specific functions.
It is easy to see that this is practically (and theoretically :-))
object-oriented: to make it canonically object oriented, all you got
to do is to create an object that holds the structure as a private
member, and include member-functions that call the specific
functions.
That makes me decide for curses/PDcurses, instead of S-Lang. slang
seems to be the wave of the future for character-based interfaces,
but i could find more documentation, samples and libraries still
using curses. If i keep developing character-based apps, i'll
certainly try slang, that looks very interesting.
I'm considering to use the screen management library in a practical
training project (mentoring?) that will help people develop an app
in DJGPP, using an OO design, and then port it to Linux. So, having
OO libraries is a nice thing.
However, in order to fully accomplish this project, i'll have to make
CDK use PD Curses as well as it uses Linux NCurses.
It doesn't look impossible: i was able to make and run some PDCurses
samples without any effort. Without the same results, i must admit.
:-) However, if it is impossible to make the two become like one,
i'll have to resort to slang. Not bad alternatives, anyway.
I hope those daydreaming thoughts may be of any help to somebody.
Best regards,
--Hilton
- Raw text -