* help with curses
@ 2003-02-16 21:22 fybar
2003-02-17 11:31 ` Joerg Bruehe
0 siblings, 1 reply; 2+ messages in thread
From: fybar @ 2003-02-16 21:22 UTC (permalink / 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: help with curses
2003-02-16 21:22 help with curses fybar
@ 2003-02-17 11:31 ` Joerg Bruehe
0 siblings, 0 replies; 2+ messages in thread
From: Joerg Bruehe @ 2003-02-17 11:31 UTC (permalink / raw)
fybar wrote:
>
> I am trying to write a program that [...]
If you are not sure about the correct target group to post to
(in this case: here, "comp.unix.tru64", or "comp.unix.programmer"),
please do _not_ post it separately ("multi-post");
rather do a "cross-post" and set a "follow-up" group.
In case anybody else wants to discuss this theme: It has started
in "comp.unix.programmer", whereto the OP also posted.
Joerg Bruehe
--
Joerg Bruehe, SQL Datenbanksysteme GmbH, Berlin, Germany
(speaking only for himself)
mailto: joerg@sql.de
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-02-17 11:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-16 21:22 help with curses fybar
2003-02-17 11:31 ` Joerg Bruehe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox