Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
rmisk
Posts: 64
Registered: ‎02-21-2012
My Device: Blackberry Playbook
My Carrier: None

ncurses

NDK is supposed to include ncurses.  Would anyone be able to point me to a simple example of where ncurses is used in NDK?

 

If I even add ncurses.h  to a new project template (Minimal Screen Application) I get the following error during build:

 

"ncurses.h:114: error: two or more data types in declaration specifiers"

 

Any suggestions on how to use ncurses in NDK would be much appreciated.

 

Roger

Please use plain text.
Developer
rmisk
Posts: 64
Registered: ‎02-21-2012
My Device: Blackberry Playbook
My Carrier: None

Re: ncurses

I have got rid of the error by not including the header:

 

#include <bps/navigator.h>

 

The printw("Hello World !!!");/* Print Hello World  */ only prints to the console in QNX Momentics IDE.  I still need to find out how to print on the tablet.

 

And, I guess I have to find out how to make getch() or a viable alternative work in ncurses as well.

 

Any sugestions?

 

Roger

 

Please use plain text.
Developer
borceg
Posts: 671
Registered: ‎03-21-2012
My Device: BlackBerry PlayBook 16GB
My Carrier: Vip

Re: ncurses

If I understand well, you want to create simple console gui right ? Take a look at https://bdsc.webapps.blackberry.com/native/reference/com.qnx.doc.screen.lib_ref/topic/cscreen_api_co...

But I think than navigation through gui commands/options will be really painful, due to lack of physical keyboard buttons
Please use plain text.
Developer
rmisk
Posts: 64
Registered: ‎02-21-2012
My Device: Blackberry Playbook
My Carrier: None

Re: ncurses

Thank you but since ncurses library is loaded in PB I assumed it is usable for more than just listing in PB advertising.  So far I have found it doesn't work with:

 

#include <bps/navigator.h>

 

and it only outputs within Momentics.  I can't get it to display anything on the PB.

 

Does ncurses provide anything useful on the PB, if so, what and how is ncurses used?

 

Roger

Please use plain text.
New Developer
npross
Posts: 29
Registered: ‎02-26-2012
My Device: Playbook, Bold 9900
My Carrier: Telus

Re: ncurses

I wrote a simple console display app that uses the freetype/opengl es code in bbutils to display text and also added a rudimentary ansi/vt100 parser.  It was more work than i expected, but now i can use ncurses :smileyhappy:.  As a proof of concept I can run ninvaders in the console.

 

So indeed ncurses does work but you need to provide some sort of framework to actually parse and display the output.  I assume you could use Qt to create the terminal window but at that point you don't really need ncurses.

 

ncurses would mostly be useful for porting existing ncurses based applications.  

 

Norm

 

 

 

Please use plain text.
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: ncurses

Exactly! ncurses does what is supposed to do and it is up to you whether to use it on PB or not? ncurses is *not* a Terminal Emulation -)

Please use plain text.