[aklug] Re: ncurses programming question

From: Michael Fowler <michael@shoebox.net>
Date: Mon Sep 29 2008 - 14:57:15 AKDT

On Sat, Sep 27, 2008 at 04:28:37PM -0800, Christopher Howard wrote:
> Hi. Have any of you done any ncurses programming with C or C++?

I have done a bit of curses programming, some in C, but mostly in Perl.
The concepts generally translate directly. However, I haven't done any
programming with curses Forms.

> I was trying to learn the ncurses interface, as sort of a stepping stone
> to real GUIs like QT. (Actually, I started with QT and then realized I
> needed to take a step back. :) )

As a means of learning a windowing toolkit, curses isn't that great a
stepping stone. Granted, both windowing toolkits and curses display to
the screen, but there the similarity pretty much ends. A windowing
toolkit typically has its own event loop, an object hierarchy for all of
the widgets you can use, and a callback interface for being updated on
events. With curses you have to write all of that from scratch.

There are some libraries that provide a windowing toolkit type
environment for curses. In Perl Curses::UI tries very hard to do it; I
don't know about C.

> The tutorial is great, overall. I've learned to do a lot of stuff with
> the these forms. However, I seem to be missing one important thing.
> How do I pull the data from the form's data buffer? (That is, so I can
> do useful things with the data.)

It looks like you want field_buffer() and possibly field_status(). You
should have man pages for both on your system. You might also want to
look at `man form`; it should list all of the available functions and
documentation.

--
Michael Fowler
www.shoebox.net
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Mon Sep 29 14:57:36 2008

This archive was generated by hypermail 2.1.8 : Mon Sep 29 2008 - 14:57:37 AKDT