LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   C++ api example for ncurses programming (http://www.linuxquestions.org/questions/programming-9/c-api-example-for-ncurses-programming-924008/)

vectrum 01-16-2012 04:19 AM

C++ api example for ncurses programming
 
Hello,

I'm looking for c++ api example for ncurses programming and needless
to say that it is not available except 7 part snake game development
video on youtube which is a bit difficult for a noob like me to
understand. GNU ncurse 5.9 documentation heading states that it has
c++ binding but couldn't find any.
I want to print simple output from cpp code inside ncurse console
window and want to use ncurse i/o like printw(),mvwprintw() etc.
with c++ i/o cout to print string or int values such as

cout << intX <<endl;

OR

cout << myObj->intVal<<endl;

and please let us know where the gnu c++ api example for ncurse is
available or where i should look into to get this with your help.
Thanks and regards...

andywebsdale 01-16-2012 05:41 PM

Try googling "ncurses C++ tutorial" - it returns loads of good links to just what you're looking for. Too many to list here, you'd have to pick your own favourite :)
Actually after having followed some of them I do see what you mean, there is a paucity of specifically C++ examples, I'm sorry to say

andywebsdale 01-16-2012 05:56 PM

I see the guy who does the "snake game" also does "Ncurses & C++" 1 to 5 from Hello world onward, then the snake game is number 6. Might be worth looking at 1 to 5 perhaps

vectrum 01-17-2012 05:30 AM

Thanks andywebsdale for your reply and you are well aware of
the scarcity of c++ info on ncurses. I've downloaded ncurses 5.9 <latest ver>. It comes with c++ dir and a example file "demo.cc" is inside it with other helper files which describes the c++ functionality of ncurses 5.9 but it's also really difficult for me understand. That demo.cc is for building
different panels.

Youtube video part 1 to part 5 teach basics of ncurses
programming like setting up attributes, changing colour, font
etc. so these parts have no c++ specific information but
part 6 videos demonstrate c++ functionality.

Thanks again. :))


All times are GMT -5. The time now is 07:02 PM.