From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,d3657a3231ad7e3f,start X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2003-02-16 13:22:39 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!pd2nf1so.cg.shawcable.net!residential.shaw.ca!news3.calgary.shaw.ca.POSTED!not-for-mail X-Trace-PostClient-IP: 24.86.181.69 From: fybar@powersurfr.com (fybar) Newsgroups: comp.unix.tru64 Subject: help with curses Message-ID: <3e5000b0.60498116@shawnews.ed.shawcable.net> X-Newsreader: Forte Free Agent 1.21/32.243 Date: Sun, 16 Feb 2003 21:22:38 GMT NNTP-Posting-Host: 24.70.95.207 X-Complaints-To: abuse@shaw.ca X-Trace: news3.calgary.shaw.ca 1045430558 24.70.95.207 (Sun, 16 Feb 2003 14:22:38 MST) NNTP-Posting-Date: Sun, 16 Feb 2003 14:22:38 MST Organization: Shaw Residential Internet Xref: archiver1.google.com comp.unix.tru64:9548 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 /* ncurses.h includes stdio.h */ #include 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