From: fybar@powersurfr.com (fybar)
Subject: help with curses
Date: Sun, 16 Feb 2003 21:22:38 GMT [thread overview]
Message-ID: <3e5000b0.60498116@shawnews.ed.shawcable.net> (raw)
I am trying to write a program that will open a file as read only and
display the contents to the user but will highlight different text
strings in different colors based upon data that will simultaneously
gathered from a real-time updated database. It seems that I could use
curses to help get this working. I am pretty much a newbie to C and
Unix programming in general so I am looking at some curses tutorials.
I am forced to develope this application on Tru64 4.0d, which doesn't
have ncurses as of now. The questions:
1. I was going to install ncurses, as it seems to be a more popular
implementation of curses, but the release notes say that I need to
install the terminfo database that comes with the package and Tru64
isn't compatable. This is a production system so I would rather not
mess it up. Is it worth the trouble to use ncurses rather than
curses?
2. I have some test applicaitons that display colors in the window.
If I am logged in via X I see colors, but no through my term emulator,
which is Kea. I have a custom bash prompt that has color in it, so I
know that it is capable of displaying the colors, why don't I see
color with the curses program I just compiled on my emulator?
3. I have a couple other programs that won't compile, they display
this error:
$> cc message.c -lcurses
ld:
Unresolved:
getmaxyx
I compile this on a FreeBSD system using curses and ncurses with no
problems. The man page for curses on my Tru64 system lists getmaxyx
as a viable function, but it still complains. Here is the source:
#include <curses.h> /* ncurses.h includes stdio.h */
#include <string.h>
int main()
{
char mesg[]="Just a string"
int row=0,col=0;
initscr(); /* start the curses mode */
getmaxyx(stdscr,row,col); /* get num of rows and cols */
mvprintw(row/2,(col-strlen(mesg))/2,"%s",mesg);
mvprintw(row-2,0,"This screen has %d rows and %d columns\n",row,col);
printw("Try resizing your window(if possible) and then run this
program again");
refresh();
getch();
endwin();
return 0;
}
Thanks!
--
fybar
next reply other threads:[~2003-02-16 21:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-16 21:22 fybar [this message]
2003-02-17 11:31 ` help with curses Joerg Bruehe
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox